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