Make _notif_timeline_generator more robust
Notifications without statuses shouldn't crash
This commit is contained in:
parent
744dc090b4
commit
8ee414c83a
1 changed files with 5 additions and 2 deletions
|
@ -290,8 +290,11 @@ def _timeline_generator(app, user, path, params=None):
|
|||
def _notif_timeline_generator(app, user, path, params=None):
|
||||
while path:
|
||||
response = http.get(app, user, path, params)
|
||||
notif = response.json()
|
||||
statuses = [n['status'] for n in notif]
|
||||
notification = response.json()
|
||||
statuses = []
|
||||
for n in notification:
|
||||
if n['status']:
|
||||
statuses.append(n['status'])
|
||||
yield statuses
|
||||
path = _get_next_path(response.headers)
|
||||
|
||||
|
|
Loading…
Reference in a new issue