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])