mirror of https://github.com/jumpserver/jumpserver
修改一个bug
parent
a6f53fc99d
commit
a25b2df453
|
@ -170,8 +170,10 @@ def login(request):
|
|||
else:
|
||||
username = request.POST.get('username')
|
||||
password = request.POST.get('password')
|
||||
user = User.objects.get(username=username)
|
||||
if password == user.password:
|
||||
user = User.objects.filter(username=username)
|
||||
if user:
|
||||
user = user[0]
|
||||
if user and password == user.password:
|
||||
request.session['username'] = username
|
||||
if user.is_admin:
|
||||
request.session['admin'] = 1
|
||||
|
@ -183,6 +185,9 @@ def login(request):
|
|||
else:
|
||||
error = '密码错误,请重新输入。'
|
||||
|
||||
else:
|
||||
error = '用户不存在。'
|
||||
|
||||
return render_to_response('login.html', {'error': error})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue