]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/base.py
Prevents questions on which the slug comes out empty to enter a redirect loop.
[osqa.git] / forum / models / base.py
index fff741c5297315df21e7ca89346366668a347027..3d54d75e95d8025efee2a6af8c97ebf3b47e60a8 100644 (file)
@@ -151,10 +151,10 @@ class BaseModel(models.Model):
             (f.name, getattr(self, f.name)) for f in self._meta.fields if self._original_state[f.attname] != self.__dict__[f.attname]
         ])
 
-    def save(self, *args, **kwargs):
+    def save(self, full_save=False, *args, **kwargs):
         put_back = [k for k, v in self.__dict__.items() if isinstance(v, models.expressions.ExpressionNode)]
 
-        if self.id:
+        if self.id and not full_save:
             self.__class__.objects.filter(id=self.id).update(**self._get_update_kwargs())
         else:
             super(BaseModel, self).save()