Handle case of no notes seen before checking notifications

This commit is contained in:
Jason McBrayer 2019-01-17 19:13:08 -05:00
parent c7fb38b57c
commit 10019b34b0
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,9 @@ def _notes_count(account, mastodon):
if account.preferences.filter_notifications:
notes = [ note for note in notes if note.type == 'mention' or note.type == 'follow']
for index, item in enumerate(notes):
if account.note_seen is None:
account.note_seen = 0
account.save()
if item.id <= account.note_seen:
break
else: