Ejemplo n.º 1
0
    def prepare_login_context(self, request, *args, **kwargs):
        can_register = bool(has_user_registration() or request.session.get("can_register"))

        context = {
            "serverHostname": get_server_hostname(),
            "canRegister": can_register,
            "hasNewsletter": newsletter.is_enabled(),
        }

        if "session_expired" in request.COOKIES:
            context["warning"] = WARN_SESSION_EXPIRED

        context.update(additional_context.run_callbacks(request))

        return context
Ejemplo n.º 2
0
    def prepare_login_context(self, request, *args, **kwargs):
        can_register = bool(auth.has_user_registration()
                            or request.session.get('can_register'))

        context = {
            'serverHostname': get_server_hostname(),
            'canRegister': can_register,
            'hasNewsletter': newsletter.is_enabled(),
        }

        if 'session_expired' in request.COOKIES:
            context['warning'] = WARN_SESSION_EXPIRED

        context.update(additional_context.run_callbacks(request))

        return context