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:
|
||||
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.save()
|
||||
super().post_save(obj, created)
|
||||
super().pre_save(obj)
|
||||
|
||||
|
||||
class OCCModelMixin(models.Model):
|
||||
|
|
Loading…
Reference in New Issue