1
0
Fork 0

[#99] Fixes a bug that would prevent upload-to path being srtptime'd.

This commit is contained in:
Adam Coddington 2016-06-01 12:57:48 -07:00
parent 456233e16b
commit 6f9c4a1166

View file

@ -1,3 +1,4 @@
import datetime
import email.header
import logging
import os
@ -130,7 +131,11 @@ def get_body_from_message(message, maintype, subtype):
def get_attachment_save_path(instance, filename):
settings = get_settings()
path = settings['attachment_upload_to']
if '%' in path:
path = datetime.datetime.utcnow().strftime(path)
return os.path.join(
settings['attachment_upload_to'],
path,
filename,
)