Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anthony
memopol
Commits
08081f26
Commit
08081f26
authored
Sep 15, 2016
by
Nicolas Joyard
Browse files
Fix exception when adding model with themes
parent
7b1382a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
memopol_themes/admin.py
View file @
08081f26
...
...
@@ -49,15 +49,12 @@ class ThemedAdminForm(forms.ModelForm):
def
save
(
self
,
commit
=
True
):
item
=
super
(
ThemedAdminForm
,
self
).
save
(
commit
=
False
)
item
.
save
()
i
f
commit
:
item
.
save
()
i
tem
.
themes
=
self
.
cleaned_data
[
'themes'
]
self
.
save
_m2m
()
if
item
.
pk
:
item
.
themes
=
self
.
cleaned_data
[
'themes'
]
self
.
save_m2m
()
return
item
return
item
class
ThemedDossierAdminForm
(
ThemedAdminForm
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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