From 10019b34b0ca724cf1e6b9ac27cbd247c3f609b4 Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Thu, 17 Jan 2019 19:13:08 -0500 Subject: [PATCH] Handle case of no notes seen before checking notifications --- brutaldon/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brutaldon/views.py b/brutaldon/views.py index 05a0ea9..acf2e87 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -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: