slightly improved email processing
This commit is contained in:
@@ -98,6 +98,7 @@ class Command(BaseCommand):
|
|||||||
cntr = 0
|
cntr = 0
|
||||||
for attachment in attachments:
|
for attachment in attachments:
|
||||||
extension = attachment.document.name[-3:].lower()
|
extension = attachment.document.name[-3:].lower()
|
||||||
|
try:
|
||||||
message = Message.objects.get(id=attachment.message_id)
|
message = Message.objects.get(id=attachment.message_id)
|
||||||
body = "\n".join(message.text.splitlines())
|
body = "\n".join(message.text.splitlines())
|
||||||
uploadoptions = uploads.upload_options(body)
|
uploadoptions = uploads.upload_options(body)
|
||||||
@@ -108,6 +109,8 @@ class Command(BaseCommand):
|
|||||||
rowers = [
|
rowers = [
|
||||||
r for r in Rower.objects.all() if r.user.email.lower() == from_address
|
r for r in Rower.objects.all() if r.user.email.lower() == from_address
|
||||||
]
|
]
|
||||||
|
except IOError:
|
||||||
|
rowers = []
|
||||||
for rower in rowers:
|
for rower in rowers:
|
||||||
if extension == 'zip':
|
if extension == 'zip':
|
||||||
zip_file = zipfile.ZipFile(attachment.document)
|
zip_file = zipfile.ZipFile(attachment.document)
|
||||||
|
|||||||
Reference in New Issue
Block a user