cleans up urls and views

This commit is contained in:
Mouse Reeve
2020-02-22 14:02:03 -08:00
parent 808ca0bd60
commit 76d2e20742
8 changed files with 216 additions and 200 deletions

View File

@ -15,10 +15,14 @@ from fedireads.broadcast import get_recipients, broadcast
@csrf_exempt
def outbox(request, username):
''' outbox for the requested user '''
user = models.User.objects.get(localname=username)
if request.method != 'GET':
return HttpResponseNotFound()
try:
user = models.User.objects.get(localname=username)
except models.User.DoesNotExist:
return HttpResponseNotFound()
# paginated list of messages
if request.GET.get('page'):
limit = 20