diff --git a/apps/notification/management/commands/animail_logs.py b/apps/notification/management/commands/animail_logs.py index 49f2bbeb..557b41d1 100644 --- a/apps/notification/management/commands/animail_logs.py +++ b/apps/notification/management/commands/animail_logs.py @@ -37,9 +37,13 @@ class Command(BaseCommand): print('r.content', r.content) return messages = r.json() - print("len(messages['items'])", len(messages['items'])) - no_attach = list(filter(lambda i: i['message']['headers']['subject'] == 'Грамота от Lil School' and not len( #options.get('subject') - i['message']['attachments']), messages['items'])) - print("len(no_attach)", len(no_attach)) - print([m['message']['headers']['to'] for m in no_attach]) + try: + print("len(messages['items'])", len(messages['items'])) + no_attach = list(filter(lambda i: i['message']['headers']['subject'] == 'Грамота от Lil School' and not len( #options.get('subject') + i['message']['attachments']), messages['items'])) + print("len(no_attach)", len(no_attach)) + print([m['message']['headers']['to'] for m in no_attach]) + except Exception as e: + print('messages', messages) + raise e