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
Political Memory
memopol
Commits
385341f9
Commit
385341f9
authored
May 22, 2017
by
Okhin
Browse files
getting rid of csrf validation on this mixin the right way, decorating dispatch
parent
b676813b
Pipeline
#1061
failed with stage
in 9 minutes and 30 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/memopol/templates/_position_form_modal.html
View file @
385341f9
...
...
@@ -13,9 +13,6 @@
</div>
<div
class=
"modal-body"
>
{% csrf_token %}
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"well well-sm text-justify"
>
{% include "text/position_info.html" %}
</div>
...
...
@@ -96,4 +93,4 @@
$
(
"
#add-position-success
"
).
modal
(
"
show
"
);
});
</script>
{% endif %}
\ No newline at end of file
{% endif %}
src/representatives_positions/views.py
View file @
385341f9
...
...
@@ -17,6 +17,10 @@ class PositionFormMixin(generic.View):
position_created
=
False
@
csrf_exempt
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
return
super
(
PositionFormMixin
,
self
).
dispatch
(
request
,
*
args
,
**
kwargs
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
if
'position-representatives'
in
request
.
POST
:
self
.
position_form
=
PositionForm
(
request
.
POST
,
prefix
=
'position'
)
...
...
okhin
🚴
@okhin
mentioned in commit
f94b1884
·
May 22, 2017
mentioned in commit
f94b1884
mentioned in commit f94b1884511b65c77eb901f8d713adcba9308d29
Toggle commit list
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