]> git.parisson.com Git - teleforma.git/commitdiff
try better duplicate
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 19 Dec 2013 16:58:45 +0000 (17:58 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 19 Dec 2013 16:58:45 +0000 (17:58 +0100)
teleforma/models/core.py

index 0ba9191551ffd5120a97000e2fb0d34e69b74101..f5816d4eef34ec16df68b163424718de736435ea 100755 (executable)
@@ -99,7 +99,7 @@ class ClonableMixin(object):
         """Return an identical copy of the instance with a new ID."""
         if not self.pk:
             raise ValueError('Instance must be saved before it can be cloned.')
-        duplicate = self
+        duplicate = copy.copy(self)
         # Setting pk to None tricks Django into thinking this is a new object.
         duplicate.pk = None
         duplicate.save()