forked from mirror/django-mailbox
[#99] Fixes a bug that would prevent upload-to path being srtptime'd.
This commit is contained in:
parent
456233e16b
commit
6f9c4a1166
1 changed files with 6 additions and 1 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue