Django Sitemap Framework integriert
This commit is contained in:
@@ -6,12 +6,16 @@ from django.core.urlresolvers import reverse
|
||||
from django.http import Http404
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views import generic
|
||||
|
||||
from django.utils.decorators import method_decorator
|
||||
from csp.decorators import csp_update
|
||||
from mahjong_ranking.models import KyuDanRanking, SeasonRanking
|
||||
from utils import mixins
|
||||
from . import forms, models
|
||||
|
||||
|
||||
RECAPTCHA_CSP = {
|
||||
'SCRIPT_SRC': ['https://www.google.com/recaptcha/', 'https://www.gstatic.com/recaptcha/'],
|
||||
'FRAME_SRC': 'https://www.google.com/recaptcha/',
|
||||
'STYLE_SRC': "'unsafe-inline'"
|
||||
}
|
||||
class ActivateRegistration(generic.DetailView):
|
||||
"""
|
||||
Activates the Registration of an User and logs him in
|
||||
@@ -109,6 +113,10 @@ class RegisterForm(generic.FormView):
|
||||
success_url = '/membership/activation_sent/'
|
||||
template_name = 'membership/register_form.html'
|
||||
|
||||
@method_decorator(csp_update(**RECAPTCHA_CSP))
|
||||
def dispatch(self, *args, **kwargs):
|
||||
return super(RegisterForm, self).dispatch(*args, **kwargs)
|
||||
|
||||
def form_valid(self, form):
|
||||
form.save()
|
||||
return generic.FormView.form_valid(self, form)
|
||||
|
||||
Reference in New Issue
Block a user