Safely return unread count when key is unset

This commit is contained in:
Mouse Reeve 2021-04-03 11:39:29 -07:00
parent 99185bbb3a
commit 8faec714bb

View file

@ -83,7 +83,7 @@ class ActivityStream(ABC):
def get_unread_count(self, user): def get_unread_count(self, user):
""" get the unread status count for this user's feed """ """ get the unread status count for this user's feed """
return int(r.get(self.unread_id(user))) return int(r.get(self.unread_id(user)) or 0)
def populate_stream(self, user): def populate_stream(self, user):
""" go from zero to a timeline """ """ go from zero to a timeline """