Commit 4040a489 by benjaoming

Merge pull request #254 from Mobeye/python3

Fix image upload when IMAGE_PATH_OBSCURIFY setting is enabled
parents ea3ef803 d43557a7
......@@ -20,9 +20,8 @@ def upload_path(instance, filename):
upload_path = settings.IMAGE_PATH
upload_path = upload_path.replace('%aid', str(instance.plugin.image.article.id))
if settings.IMAGE_PATH_OBSCURIFY:
import random, hashlib
m=hashlib.md5(str(random.randint(0,100000000000000)))
upload_path = os.path.join(upload_path, m.hexdigest())
import uuid
upload_path = os.path.join(upload_path, uuid.uuid4().hex)
return os.path.join(upload_path, filename)
class Image(RevisionPlugin):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment