Simpler feed verification logic

This commit is contained in:
Mouse Reeve 2021-08-28 09:42:03 -07:00
parent 691f9c01c4
commit 4fb834f10f

View file

@ -96,15 +96,11 @@ class Status(View):
try:
user = get_user_from_username(request.user, username)
status = models.Status.objects.select_subclasses().get(
id=status_id, deleted=False
user=user, id=status_id, deleted=False
)
except (ValueError, models.Status.DoesNotExist):
return HttpResponseNotFound()
# the url should have the poster's username in it
if user != status.user:
return HttpResponseNotFound()
# make sure the user is authorized to see the status
if not status.visible_to_user(request.user):
return HttpResponseNotFound()