~netlandish/django-wiki

55a4a5b2d6d5036171445f4d39b695f80f143332 — Tae-lim Oh 11 years ago 15a33ea
in attachments plugin, append '.upload' to uploaded files only when settings.APPEND_EXTENSION is True.
1 files changed, 4 insertions(+), 1 deletions(-)

M wiki/plugins/attachments/models.py
M wiki/plugins/attachments/models.py => wiki/plugins/attachments/models.py +4 -1
@@ 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):