Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Julien Jerphanion
Rex Dri
Commits
fd1835e9
Commit
fd1835e9
authored
Feb 26, 2019
by
Florent Chehab
Browse files
Removed my_save from MyModel files
parent
69b66577
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/backend_app/models/abstract/my_model/myModelSerializer.py
View file @
fd1835e9
...
...
@@ -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
...
...
backend/backend_app/models/abstract/my_model/myModelVersionned.py
View file @
fd1835e9
...
...
@@ -65,7 +65,7 @@ class MyModelVersionnedSerializer(MyModelSerializer):
"""
with
reversion
.
create_revision
():
res
=
s
elf
.
my_
save
(
*
args
,
**
kwargs
)
res
=
s
uper
().
save
(
*
args
,
**
kwargs
)
reversion
.
set_user
(
res
.
updated_by
)
new_revision_saved
.
send
(
sender
=
self
.
__class__
,
obj
=
self
.
instance
)
return
res
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment