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
jaster
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
Changes
2
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'
)
...
...
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