Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
warpinfra
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christian Dresen
warpinfra
Commits
1dcdbaab
Commit
1dcdbaab
authored
8 years ago
by
Christian Dresen
Browse files
Options
Downloads
Patches
Plain Diff
[WarpAuth] Enable error message if trying to log in with a deactivated account
parent
19a90d40
Branches
master
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
www/web/warpauth/templates/warpauth/login.html
+2
-2
2 additions, 2 deletions
www/web/warpauth/templates/warpauth/login.html
www/web/warpauth/views/login.py
+4
-1
4 additions, 1 deletion
www/web/warpauth/views/login.py
with
6 additions
and
3 deletions
www/web/warpauth/templates/warpauth/login.html
+
2
−
2
View file @
1dcdbaab
...
...
@@ -11,9 +11,9 @@
<label
for=
"inputPassword"
style=
"padding-top:10px;"
>
{% trans "Password" %}
</label>
<input
name=
"password"
type=
"password"
id=
"inputPassword"
class=
"form-control"
placeholder=
"{% trans "
Password
"
%}"
required
>
{% if
fail == True
%}
{% if
error
%}
<div
class=
"alert alert-warning alert-dismissible"
role=
"alert"
>
<strong>
{
% trans "Invalid email or password." %
}
</strong>
<strong>
{
{ error }
}
</strong>
</div>
{% else %}
<br>
...
...
This diff is collapsed.
Click to expand it.
www/web/warpauth/views/login.py
+
4
−
1
View file @
1dcdbaab
...
...
@@ -5,6 +5,7 @@ from django.shortcuts import redirect
from
django.contrib.auth.decorators
import
login_required
from
django.utils
import
translation
from
warpauth.util
import
*
from
django.utils.translation
import
ugettext
as
_
def
login_view
(
request
):
pages
[
'
page_title
'
]
=
"
Login
"
...
...
@@ -23,9 +24,11 @@ def login_view(request):
translation
.
activate
(
user_language
)
request
.
session
[
translation
.
LANGUAGE_SESSION_KEY
]
=
user_language
return
redirect
(
'
/
'
)
else
:
pages
[
'
error
'
]
=
_
(
"
Your account is deactivated. Please contact an administrator.
"
)
else
:
if
username
!=
""
and
password
!=
""
:
pages
[
'
fail
'
]
=
True
pages
[
'
error
'
]
=
_
(
"
Invalid email or password.
"
)
return
HttpResponse
(
render
(
request
,
'
warpauth/login.html
'
,
pages
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment