mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
Added django-login-required-middleware
Thus eliminating need for login_requred decorator on every view
This commit is contained in:
parent
6d82c2820b
commit
38befa4362
14 changed files with 12 additions and 54 deletions
|
@ -15,9 +15,9 @@
|
|||
{% endif %}
|
||||
<form class="form-signin" method="post" role="form">{% csrf_token %}
|
||||
<h2 class="form-signin-heading">{% trans "Sign In" %}</h2>
|
||||
<input type="text" class="form-control" name="username" placeholder="Login" autocapitalize="none" autocorrect="off" autofocus>
|
||||
<input type="password" class="form-control" name="password" placeholder="Password">
|
||||
<input name="next" id="next" type="hidden" value="{% url 'allinstances' %}">
|
||||
<input type="text" class="form-control" name="username" placeholder="{% trans "Login" %}" autocapitalize="none" autocorrect="off" autofocus>
|
||||
<input type="password" class="form-control" name="password" placeholder="{% trans "Password" %}">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<button class="btn btn-lg btn-success btn-block" type="submit">{% trans "Sign In" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.shortcuts import render
|
|||
from django.http import HttpResponseRedirect
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from accounts.models import *
|
||||
from instances.models import Instance
|
||||
from accounts.forms import UserAddForm
|
||||
|
@ -10,7 +9,6 @@ from django.conf import settings
|
|||
from django.core.validators import ValidationError
|
||||
|
||||
|
||||
@login_required
|
||||
def profile(request):
|
||||
"""
|
||||
:param request:
|
||||
|
@ -69,7 +67,6 @@ def profile(request):
|
|||
return render(request, 'profile.html', locals())
|
||||
|
||||
|
||||
@login_required
|
||||
def accounts(request):
|
||||
"""
|
||||
:param request:
|
||||
|
@ -149,7 +146,6 @@ def accounts(request):
|
|||
return render(request, accounts_template_file, locals())
|
||||
|
||||
|
||||
@login_required
|
||||
def account(request, user_id):
|
||||
"""
|
||||
:param request:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue