]> git.parisson.com Git - teleforma.git/commitdiff
fix indentical filename
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 1 Aug 2014 19:21:25 +0000 (21:21 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 1 Aug 2014 19:21:25 +0000 (21:21 +0200)
teleforma/exam/models.py

index 9c847c25fe154d7c2a10ae0b58052785fce13c17..181b8048d1c7041c104d109ce10ce9e60b15d00b 100644 (file)
@@ -300,7 +300,7 @@ 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):
+        if os.path.exists(new_abs) and not old_abs == new_abs:
             new_abs = os.sep.join(old_abs_root) + os.sep + unicode(self.uuid) + ext
             new_rel = os.sep.join(old_rel_root) + os.sep + unicode(self.uuid) + ext