Merge pull request #73 from cyisfor/last_seen_index_error

random exception when viewing notifications
This commit is contained in:
GCU Prosthetic Conscience 2020-06-01 10:36:23 -04:00 committed by GitHub
commit 9a99f34945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -605,7 +605,10 @@ def note(request, next=None, prev=None):
account, mastodon = get_usercontext(request) account, mastodon = get_usercontext(request)
except NotLoggedInException: except NotLoggedInException:
return redirect(about) return redirect(about)
try:
last_seen = mastodon.notifications(limit=1)[0] last_seen = mastodon.notifications(limit=1)[0]
except IndexError: pass
else:
account.note_seen = last_seen.id account.note_seen = last_seen.id
account.save() account.save()