views: make /cgu/ redirect to https://portail-platform.grandlyon.com/mentions-legales/ (#84480)
gitea/authentic2-cut/pipeline/head There was a failure building this commit
Details
gitea/authentic2-cut/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
5ec29713db
commit
b34603cbcf
|
@ -28,7 +28,7 @@ from django.db.transaction import atomic
|
|||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views.generic.base import TemplateView
|
||||
from django.views.generic.base import RedirectView, TemplateView
|
||||
|
||||
from . import forms, models, tables, utils
|
||||
from .custom_settings import CORE_ATTRIBUTES
|
||||
|
@ -155,12 +155,12 @@ class ManagerUserDetailView(UserDetailView):
|
|||
manager_user_detail = ManagerUserDetailView.as_view()
|
||||
|
||||
|
||||
class CGU(TemplateView):
|
||||
template_name = 'authentic2/cut_cgu.html'
|
||||
class CGU(RedirectView):
|
||||
permanent = True
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
kwargs['cut_base_url'] = self.request.build_absolute_uri('/')
|
||||
return super().get_context_data(**kwargs)
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
host = self.request.get_host()
|
||||
return f'https://portail-{host}/mentions-legales/'
|
||||
|
||||
|
||||
cgu = CGU.as_view()
|
||||
|
|
Loading…
Reference in New Issue