From 55a4a5b2d6d5036171445f4d39b695f80f143332 Mon Sep 17 00:00:00 2001 From: Tae-lim Oh Date: Wed, 16 Jan 2013 17:25:54 +0900 Subject: [PATCH] in attachments plugin, append '.upload' to uploaded files only when settings.APPEND_EXTENSION is True. --- wiki/plugins/attachments/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wiki/plugins/attachments/models.py b/wiki/plugins/attachments/models.py index dab8b70c..fd9d5d65 100644 --- a/wiki/plugins/attachments/models.py +++ b/wiki/plugins/attachments/models.py @@ -73,7 +73,10 @@ def upload_path(instance, filename): import random, hashlib m=hashlib.md5(str(random.randint(0,100000000000000))) upload_path = path.join(upload_path, m.hexdigest()) - return path.join(upload_path, filename + '.upload') + + if settings.APPEND_EXTENSION: + filename += '.upload' + return path.join(upload_path, filename) class AttachmentRevision(BaseRevisionMixin, models.Model): -- 2.45.2