From 30a1cf1ef0592978b4f1c2019c21cbfc9a6b8ff2 Mon Sep 17 00:00:00 2001 From: gzbender Date: Fri, 12 Jul 2019 20:33:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B5=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=D0=B8=D1=81=D1=8C=20=D0=B3=D1=80=D0=B0=D0=BC?= =?UTF-8?q?=D0=BE=D1=82=D1=8B=20=D0=B7=D0=B0=20=D1=80=D0=B8=D1=81=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=BB=D0=B0=D0=B3?= =?UTF-8?q?=D0=B5=D1=80=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../management/commands/animail_logs.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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