forked from CGM_Public/pretix_original
Fixed problem in LocaleSet view with view names in next= parameters
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.shortcuts import redirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.utils.http import is_safe_url
|
from django.utils.http import is_safe_url
|
||||||
from django.views.generic import View
|
from django.views.generic import View
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ class LocaleSet(View):
|
|||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
url = request.GET.get('next', request.META.get('HTTP_REFERER', '/'))
|
url = request.GET.get('next', request.META.get('HTTP_REFERER', '/'))
|
||||||
url = url if is_safe_url(url, host=request.get_host()) else '/'
|
url = url if is_safe_url(url, host=request.get_host()) else '/'
|
||||||
resp = redirect(url)
|
resp = HttpResponseRedirect(url)
|
||||||
|
|
||||||
locale = request.GET.get('locale')
|
locale = request.GET.get('locale')
|
||||||
if locale in [lc for lc, ll in settings.LANGUAGES]:
|
if locale in [lc for lc, ll in settings.LANGUAGES]:
|
||||||
|
|||||||
Reference in New Issue
Block a user