]> git.parisson.com Git - teleforma.git/commitdiff
no uuid renaming (django makes the job)
authorGuillaume Pellerin <yomguy@parisson.com>
Sat, 19 Jul 2014 21:18:20 +0000 (23:18 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Sat, 19 Jul 2014 21:18:20 +0000 (23:18 +0200)
teleforma/exam/models.py

index b40e22e402efdb703c3bc3c650ff98f95ad94a91..6e5c8e95074c0de95c2222512b5eacc7594e9b9b 100644 (file)
@@ -294,9 +294,9 @@ class Script(BaseResource):
         new_abs = os.sep.join(old_abs_root) + os.sep + slugify(filename) + ext
         new_rel = os.sep.join(old_rel_root) + os.sep + slugify(filename) + ext
 
-        if os.path.exists(new_abs):
-            new_abs = os.sep.join(old_abs_root) + os.sep + slugify(filename) + '_' + unicode(self.uuid) + ext
-            new_rel = os.sep.join(old_rel_root) + os.sep + slugify(filename) + '_' + unicode(self.uuid) + ext
+        if os.path.exists(new_abs):
+            new_abs = os.sep.join(old_abs_root) + os.sep + slugify(filename) + '_' + unicode(self.uuid) + ext
+            new_rel = os.sep.join(old_rel_root) + os.sep + slugify(filename) + '_' + unicode(self.uuid) + ext
 
         os.rename(old_abs, new_abs)
         self.file = new_rel