Refactor get_user_from_username to raise 404 directly
This commit is contained in:
parent
d810d1bb8c
commit
4dacf4df3a
6 changed files with 21 additions and 38 deletions
|
@ -25,10 +25,7 @@ class Shelf(View):
|
|||
|
||||
def get(self, request, username, shelf_identifier=None):
|
||||
"""display a shelf"""
|
||||
try:
|
||||
user = get_user_from_username(request.user, username)
|
||||
except models.User.DoesNotExist:
|
||||
return HttpResponseNotFound()
|
||||
user = get_user_from_username(request.user, username)
|
||||
|
||||
shelves = privacy_filter(request.user, user.shelf_set)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue