mirror of
https://gitlab.com/brutaldon/brutaldon.git
synced 2025-01-03 14:56:25 -05:00
random exception when viewing notifications
I think it's a rare occasion that there are no last seen notifications, in which case just ignoring it and setting account.note_seen later works fine.
This commit is contained in:
parent
00e35409ef
commit
c3f6503bec
@ -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()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user