1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

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