Updating current version in presave instead of doing it in the post_save method
parent
e534920c01
commit
37e61071bf
|
@ -31,12 +31,8 @@ class OCCResourceMixin(object):
|
||||||
if current_version != param_version:
|
if current_version != param_version:
|
||||||
raise exc.WrongArguments({"version": "The version doesn't match with the current one"})
|
raise exc.WrongArguments({"version": "The version doesn't match with the current one"})
|
||||||
|
|
||||||
super().pre_save(obj)
|
|
||||||
|
|
||||||
def post_save(self, obj, created=False):
|
|
||||||
obj.version += 1
|
obj.version += 1
|
||||||
obj.save()
|
super().pre_save(obj)
|
||||||
super().post_save(obj, created)
|
|
||||||
|
|
||||||
|
|
||||||
class OCCModelMixin(models.Model):
|
class OCCModelMixin(models.Model):
|
||||||
|
|
Loading…
Reference in New Issue