Adds blocked users view

also refactors the setting view
This commit is contained in:
Mouse Reeve
2021-01-26 09:56:01 -08:00
parent 3f011445e2
commit acfc865d4e
11 changed files with 273 additions and 178 deletions

View File

@@ -1,6 +1,7 @@
''' views for actions you can take in the application '''
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
from django.views import View
@@ -13,6 +14,8 @@ class Block(View):
''' blocking users '''
def get(self, request):
''' list of blocked users? '''
return TemplateResponse(
request, 'blocks.html', {'title': 'Blocked Users'})
def post(self, request, user_id):
''' block a user '''
@@ -26,4 +29,4 @@ class Block(View):
privacy='direct',
direct_recipients=[to_block]
)
return redirect('/blocks')
return redirect('/block')