|
|
|
|
@ -1,6 +1,5 @@ |
|
|
|
|
from django.core.management.base import BaseCommand |
|
|
|
|
from django.conf import settings |
|
|
|
|
import json |
|
|
|
|
import requests |
|
|
|
|
|
|
|
|
|
class Command(BaseCommand): |
|
|
|
|
@ -34,7 +33,10 @@ class Command(BaseCommand): |
|
|
|
|
"limit": options.get('limit'), |
|
|
|
|
"pretty": "yes", }) |
|
|
|
|
print(r) |
|
|
|
|
messages = json.loads(r.content) |
|
|
|
|
if r.status_code != 200: |
|
|
|
|
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'])) |
|
|
|
|
|