Commit 592fc6d7 authored by okhin's avatar okhin 🚴
Browse files

Merge branch '195-csrf-verification-failed-csrf-cookie-when-submitting-forms' into 'master'

Let's enforce csrf on home, it seems the cookie is never sent to the client only…

Closes #195

See merge request !204
parents c8d4df46 8cc240ed
Pipeline #1068 passed with stages
in 10 minutes and 24 seconds
......@@ -5,6 +5,8 @@ import random
from django.db.models import Q, Count
from django.views import generic
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect
from representatives.models import Chamber, Representative
from representatives_positions.views import PositionFormMixin
......@@ -20,6 +22,10 @@ class HomeView(PositionFormMixin, RepresentativeViewMixin,
template_name = 'home.html'
def dispatch(self, *args, **kwargs):
return super(HomeView, self).dispatch(*args, **kwargs)
def get_context_data(self, **kwargs):
c = super(HomeView, self).get_context_data(**kwargs)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment