Skip to content

Commit

Permalink
fix subscriptable nonetype issue on notifications page
Browse files Browse the repository at this point in the history
  • Loading branch information
c-e-p committed May 26, 2023
1 parent 7a178a7 commit 2f0da92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ourchive_app/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ def user_bookmarks(request, username):
def user_notifications(request, username):
if request.user.is_authenticated:
response = do_get(f'api/users/{request.user.id}/', request, params=request.GET)
has_notifications = response[0]['userprofile']['has_notifications']
request.session['has_notifications'] = has_notifications
if response[0] is not None and response[0]['userprofile'] is not None:
has_notifications = response[0]['userprofile']['has_notifications']
request.session['has_notifications'] = has_notifications
else:
request.session['has_notifications'] = False
response = do_get(f'api/users/{username}/notifications', request, params=request.GET)
Expand Down

0 comments on commit 2f0da92

Please sign in to comment.