From 2074ab161aa446f748deccc1ed709acdc4b67bd4 Mon Sep 17 00:00:00 2001 From: gzbender Date: Thu, 11 Jul 2019 23:54:49 +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 --- apps/notification/management/commands/animail_logs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/notification/management/commands/animail_logs.py b/apps/notification/management/commands/animail_logs.py index c1df0c42..a7e0f4bb 100644 --- a/apps/notification/management/commands/animail_logs.py +++ b/apps/notification/management/commands/animail_logs.py @@ -14,7 +14,7 @@ class Command(BaseCommand): dest='limit', help='Limit', ) - parser.add_argument( + '''parser.add_argument( '--date', dest='date', help='Date', @@ -23,20 +23,20 @@ class Command(BaseCommand): '--subject', dest='subject', help='Subject', - ) + )''' def handle(self, *args, **options): r = requests.get( "https://api.mailgun.net/v3/%s/events" % settings.ANYMAIL['MAILGUN_SENDER_DOMAIN'], auth=("api", settings.ANYMAIL['MAILGUN_API_KEY']), - params={"begin": options.get('date'), + params={"begin": "Wed, 10 Jul 19 00:00:00 +0000", #options.get('date') "ascending": "yes", "limit": options.get('limit'), "pretty": "yes", }) print(r) messages = json.loads(r.content) print("len(messages['items'])", len(messages['items'])) - no_attach = list(filter(lambda i: i['message']['headers']['subject'] == options.get('subject') and not len( + 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])