Browse Source

Fixes #1150: Error when uploading image attachments with Unicode names under Python 2

Jeremy Stretch 8 years ago
parent
commit
8e333757f9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      netbox/extras/models.py

+ 1 - 1
netbox/extras/models.py

@@ -383,7 +383,7 @@ def image_upload(instance, filename):
     elif instance.name:
         filename = instance.name
 
-    return '{}{}_{}_{}'.format(path, instance.content_type.name, instance.object_id, filename)
+    return u'{}{}_{}_{}'.format(path, instance.content_type.name, instance.object_id, filename)
 
 
 @python_2_unicode_compatible