mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 15:23:52 -05:00
View for handling follow requests
This commit is contained in:
parent
c192d0056e
commit
d3ed8eef27
@ -972,10 +972,7 @@ def emoji_reference(request):
|
||||
|
||||
@br_login_required
|
||||
def list_filters(request):
|
||||
try:
|
||||
account, mastodon = get_usercontext(request)
|
||||
except NotLoggedInException:
|
||||
return redirect(about)
|
||||
filters = mastodon.filters()
|
||||
return render(request, 'filters/list.html',
|
||||
{'account': account,
|
||||
@ -1079,3 +1076,22 @@ def edit_filter(request, id):
|
||||
'account': account,
|
||||
'filter': filter,
|
||||
'preferences': account.preferences})
|
||||
|
||||
@br_login_required
|
||||
def follow_requests(request, id=None):
|
||||
account, mastodon = get_usercontext(request)
|
||||
if request.method == 'GET':
|
||||
reqs = mastodon.follow_requests()
|
||||
return render(request, 'requests/list.html',
|
||||
{'account': account,
|
||||
'preferences': account.preferences,
|
||||
'requests': reqs})
|
||||
elif id is None:
|
||||
return redirect(follow_requests)
|
||||
else:
|
||||
if request.POST.get("accept", None):
|
||||
mastodon.follow_request_authorize(id)
|
||||
elif request.POST.get("rejest", None):
|
||||
mastodon.follow_request_reject(id)
|
||||
return redirect(follow_requests)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user