Browse Source

encode secret before hashing for py3.5k

Rafał Pitoń 8 years ago
parent
commit
c436801416
1 changed files with 1 additions and 1 deletions
  1. 1 1
      misago/threads/models/attachment.py

+ 1 - 1
misago/threads/models/attachment.py

@@ -16,7 +16,7 @@ from misago.core.utils import slugify
 
 def upload_to(instance, filename):
     try:
-        spread_path = md5(instance.secret[:16]).hexdigest()
+        spread_path = md5(str(instance.secret[:16]).encode()).hexdigest()
         secret = Attachment.generate_new_secret()
 
         filename_lowered = filename.lower().strip()