Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
salt-observer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
salt-observer
Commits
6d31f75b
Commit
6d31f75b
authored
9 years ago
by
Tim Fechner
Committed by
Tim Fechner
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix missing model.save() on edit view
parent
ed5857d0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
salt_observer/views.py
+4
-1
4 additions, 1 deletion
salt_observer/views.py
with
4 additions
and
1 deletion
salt_observer/views.py
+
4
−
1
View file @
6d31f75b
...
@@ -25,12 +25,15 @@ from salt_observer.models import (
...
@@ -25,12 +25,15 @@ from salt_observer.models import (
class
MarkdownEditMixin
(
object
):
class
MarkdownEditMixin
(
object
):
def
form_valid
(
self
,
form
,
*
args
,
**
kwargs
):
def
form_valid
(
self
,
form
,
*
args
,
**
kwargs
):
result
=
super
().
form_valid
(
form
,
*
args
,
**
kwargs
)
obj
=
self
.
get_object
()
obj
=
self
.
get_object
()
obj
.
md_content
=
form
.
cleaned_data
.
get
(
'
md_content
'
,
''
)
obj
.
md_content
=
form
.
cleaned_data
.
get
(
'
md_content
'
,
''
)
obj
.
md_last_autor
=
self
.
request
.
user
obj
.
md_last_autor
=
self
.
request
.
user
obj
.
md_last_edited
=
timezone
.
now
()
obj
.
md_last_edited
=
timezone
.
now
()
obj
.
save
()
obj
.
save
()
return
super
().
form_valid
(
form
,
*
args
,
**
kwargs
)
return
result
def
get_success_url
(
self
,
*
args
,
**
kwargs
):
def
get_success_url
(
self
,
*
args
,
**
kwargs
):
return
reverse_lazy
(
self
.
success_url_name
,
args
=
[
self
.
kwargs
.
get
(
'
slug
'
,
''
)])
return
reverse_lazy
(
self
.
success_url_name
,
args
=
[
self
.
kwargs
.
get
(
'
slug
'
,
''
)])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment