1
0
Fork 0

Merge pull request #1337 from bookwyrm-social/feed-logic

Feed logic
This commit is contained in:
Mouse Reeve 2021-08-28 11:29:37 -07:00 committed by GitHub
commit 41ed5f3103
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 5 deletions

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()