slightly improved email processing
This commit is contained in:
@@ -98,16 +98,19 @@ 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()
|
||||||
message = Message.objects.get(id=attachment.message_id)
|
try:
|
||||||
body = "\n".join(message.text.splitlines())
|
message = Message.objects.get(id=attachment.message_id)
|
||||||
uploadoptions = uploads.upload_options(body)
|
body = "\n".join(message.text.splitlines())
|
||||||
from_address = message.from_address[0].lower()
|
uploadoptions = uploads.upload_options(body)
|
||||||
name = message.subject
|
from_address = message.from_address[0].lower()
|
||||||
# get a list of users
|
name = message.subject
|
||||||
# theusers = User.objects.filter(email=from_address)
|
# get a list of users
|
||||||
rowers = [
|
# theusers = User.objects.filter(email=from_address)
|
||||||
r for r in Rower.objects.all() if r.user.email.lower() == from_address
|
rowers = [
|
||||||
]
|
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