コード例 #1
0
ファイル: views.py プロジェクト: Cka3o4Huk/reviewboard
def account_register(request):
    """
    Handles redirection to the appropriate registration page, depending
    on the authentication type the user has configured.
    """
    siteconfig = SiteConfiguration.objects.get_current()
    auth_backend = siteconfig.get("auth_backend")

    if (auth_backend == "builtin" and
        siteconfig.get("auth_enable_registration")):
        return register(request, next_page=settings.SITE_ROOT + 'dashboard/')

    return HttpResponseRedirect(reverse("login"))
コード例 #2
0
ファイル: views.py プロジェクト: Kamlani/reviewboard
def account_register(request, next_url='dashboard'):
    """
    Handles redirection to the appropriate registration page, depending
    on the authentication type the user has configured.
    """
    siteconfig = SiteConfiguration.objects.get_current()
    auth_backends = get_auth_backends()

    if (auth_backends[0].supports_registration and
        siteconfig.get("auth_enable_registration")):

        return register(request,
                        next_page=reverse(next_url),
                        form_class=RegistrationForm)

    return HttpResponseRedirect(reverse("login"))
コード例 #3
0
def account_register(request, next_url='dashboard'):
    """
    Handles redirection to the appropriate registration page, depending
    on the authentication type the user has configured.
    """
    siteconfig = SiteConfiguration.objects.get_current()
    auth_backends = get_auth_backends()

    if (auth_backends[0].supports_registration
            and siteconfig.get("auth_enable_registration")):

        return register(request,
                        next_page=reverse(next_url),
                        form_class=RegistrationForm)

    return HttpResponseRedirect(reverse("login"))
コード例 #4
0
ファイル: views.py プロジェクト: CharanKamal-CLI/reviewboard
def account_register(request, next_url='dashboard'):
    """Display the appropriate registration page.

    If registration is enabled and the selected authentication backend supports
    creation of users, this will return the appropriate registration page. If
    registration is not supported, this will redirect to the login view.
    """
    siteconfig = SiteConfiguration.objects.get_current()
    auth_backends = get_enabled_auth_backends()

    if (auth_backends[0].supports_registration and
            siteconfig.get("auth_enable_registration")):
        response = register(request, next_page=reverse(next_url),
                            form_class=RegistrationForm)

        return response

    return HttpResponseRedirect(reverse("login"))
コード例 #5
0
ファイル: views.py プロジェクト: prodigeni/reviewboard
def account_register(request, next_url="dashboard"):
    """
    Handles redirection to the appropriate registration page, depending
    on the authentication type the user has configured.
    """
    siteconfig = SiteConfiguration.objects.get_current()
    auth_backends = get_auth_backends()

    if auth_backends[0].supports_registration and siteconfig.get("auth_enable_registration"):
        response = register(request, next_page=reverse(next_url), form_class=RegistrationForm)

        if request.user.is_authenticated():
            # This will trigger sending an e-mail notification for
            # user registration, if enabled.
            user_registered.send(sender=None, user=request.user)

        return response

    return HttpResponseRedirect(reverse("login"))
コード例 #6
0
ファイル: views.py プロジェクト: yjstyle/reviewboard
def account_register(request, next_url='dashboard'):
    """Display the appropriate registration page.

    If registration is enabled and the selected authentication backend supports
    creation of users, this will return the appropriate registration page. If
    registration is not supported, this will redirect to the login view.
    """
    siteconfig = SiteConfiguration.objects.get_current()
    auth_backends = get_enabled_auth_backends()

    if (auth_backends[0].supports_registration
            and siteconfig.get("auth_enable_registration")):
        response = register(request,
                            next_page=reverse(next_url),
                            form_class=RegistrationForm)

        return response

    return HttpResponseRedirect(reverse("login"))
コード例 #7
0
ファイル: views.py プロジェクト: aaronmartin0303/reviewboard
def account_register(request, next_url='dashboard'):
    """
    Handles redirection to the appropriate registration page, depending
    on the authentication type the user has configured.
    """
    siteconfig = SiteConfiguration.objects.get_current()
    auth_backends = get_enabled_auth_backends()

    if (auth_backends[0].supports_registration and
            siteconfig.get("auth_enable_registration")):
        response = register(request, next_page=reverse(next_url),
                            form_class=RegistrationForm)

        if request.user.is_authenticated():
            # This will trigger sending an e-mail notification for
            # user registration, if enabled.
            user_registered.send(sender=None, user=request.user)

        return response

    return HttpResponseRedirect(reverse("login"))