book media rename bugfix
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 30 Aug 2011 15:50:32 +0000 (17:50 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 30 Aug 2011 15:50:32 +0000 (17:50 +0200)
apps/catalogue/models.py

index a0ebf05..cda5ba5 100644 (file)
@@ -205,7 +205,7 @@ class BookMedia(models.Model):
             pass
         else:
             # if name changed, change the file name, too
-            if self.name != old.name:
+            if slughifi(self.name) != slughifi(old.name):
                 self.file.save(None, ExistingFile(self.file.path), save=False, leave=True)
 
         super(BookMedia, self).save(*args, **kwargs)