Handle cases when the user does not have site added yet
This commit is contained in:
parent
40cf4f2c2a
commit
6b33ad8a32
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ from Debug import Debug
|
|||
class UiWebsocketPlugin(object):
|
||||
def formatSiteInfo(self, site, create_user=True):
|
||||
site_info = super(UiWebsocketPlugin, self).formatSiteInfo(site, create_user=create_user)
|
||||
feed_following = self.user.sites[site.address].get("follow", None)
|
||||
feed_following = self.user.sites.get(site.address, {}).get("follow", None)
|
||||
if feed_following == None:
|
||||
site_info["feed_follow_num"] = None
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue