Ejemplo n.º 1
0
    def wrap(request, *args, **kwargs):

        if not request.session.get(encoded_admin_session_variable_name(), False):
            return redirect("/spudderadmin")
        return function(request, *args, **kwargs)

        wrap.__doc__ = function.__doc__
        wrap.__name__ = function.__name__
Ejemplo n.º 2
0
def signin(request):
    form = QASigninForm()
    if request.method == "POST":
        form = QASigninForm(request.POST)
        if form.is_valid():
            request.session[encoded_admin_session_variable_name()] = True
            return redirect("/qa/dashboard")
    return render(request, "spudderqa/pages/signin.html", {"form": form})
Ejemplo n.º 3
0
def signin(request):
    form = QASigninForm()
    if request.method == 'POST':
        form = QASigninForm(request.POST)
        if form.is_valid():
            request.session[encoded_admin_session_variable_name()] = True
            return redirect("/qa/dashboard")
    return render(request, 'spudderqa/pages/signin.html', {'form': form})
Ejemplo n.º 4
0
def admin_login(request):
    error = False
    if request.method == 'POST':
        error = True
        if request.POST.get('username', None) == '*****@*****.**' and \
           request.POST.get('password', None) == 'spudmart1':
            request.session[encoded_admin_session_variable_name()] = True
            return redirect(admin_dashboard)
    return render_to_response('spudderadmin/pages/login.html',
                              {'error': error},
                              context_instance=RequestContext(request))
Ejemplo n.º 5
0
    def wrap(request, *args, **kwargs):

        # if settings.ENVIRONMENT == Environments.LIVE:
        #     raise Http404

        if not request.session.get(encoded_admin_session_variable_name(), False):
            return redirect('/qa/signin')
        return function(request, *args, **kwargs)

        wrap.__doc__ = function.__doc__
        wrap.__name__ = function.__name__
Ejemplo n.º 6
0
    def wrap(request, *args, **kwargs):

        # if settings.ENVIRONMENT == Environments.LIVE:
        #     raise Http404

        if not request.session.get(encoded_admin_session_variable_name(),
                                   False):
            return redirect('/qa/signin')
        return function(request, *args, **kwargs)

        wrap.__doc__ = function.__doc__
        wrap.__name__ = function.__name__
Ejemplo n.º 7
0
def admin_login(request):
    error = False
    if request.method == 'POST':
        error = True
        if request.POST.get('username', None) == '*****@*****.**' and \
           request.POST.get('password', None) == 'spudmart1':
            request.session[encoded_admin_session_variable_name()] = True
            return redirect(admin_dashboard)
    return render_to_response(
        'spudderadmin/pages/login.html',
        {'error': error},
        context_instance=RequestContext(request))