Commit fd1835e9 authored by Florent Chehab's avatar Florent Chehab

Removed my_save from MyModel files

parent 69b66577
Pipeline #35532 passed with stages
in 4 minutes and 32 seconds
......@@ -147,15 +147,10 @@ class MyModelSerializer(MySerializerWithJSON):
pass
def save(self, *args, **kwargs):
"""
TODO analyse, usefull ?
"""
return self.my_save(*args, **kwargs)
def my_save(self, *args, **kwargs):
"""
Function that handles all the moderation in a smart way.
Nothing has to be done to tell that we won't the data to be moderated, it is detected automatically.
Nothing has to be done to tell that we won't the data to be moderated,
it is detected automatically.
"""
user = self.context["request"].user
......
......@@ -65,7 +65,7 @@ class MyModelVersionnedSerializer(MyModelSerializer):
"""
with reversion.create_revision():
res = self.my_save(*args, **kwargs)
res = super().save(*args, **kwargs)
reversion.set_user(res.updated_by)
new_revision_saved.send(sender=self.__class__, obj=self.instance)
return res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment