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