Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ICNML
web app
Commits
01fc0451
Commit
01fc0451
authored
5 years ago
by
Marco De Donno
Browse files
Options
Downloads
Patches
Plain Diff
Add an error message for the user if the account is not activated
parent
a36eb3fc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
module.py
+16
-7
16 additions, 7 deletions
module.py
templates/login.html
+6
-2
6 additions, 2 deletions
templates/login.html
with
22 additions
and
9 deletions
module.py
+
16
−
7
View file @
01fc0451
...
@@ -80,13 +80,22 @@ def do_login():
...
@@ -80,13 +80,22 @@ def do_login():
}
)
}
)
if
pbkdf2
(
request
.
form
.
get
(
"
password
"
),
user
[
'
password
'
]
):
if
pbkdf2
(
request
.
form
.
get
(
"
password
"
),
user
[
'
password
'
]
):
session
[
'
logged
'
]
=
True
if
not
user
[
'
active
'
]:
session
[
'
session_id
'
]
=
str
(
uuid4
()
)
session
.
clear
()
session
[
'
username
'
]
=
user
[
'
username
'
]
return
jsonify
(
{
return
jsonify
(
{
'
error
'
:
False
,
'
error
'
:
False
,
'
logged
'
:
False
,
'
logged
'
:
True
,
'
message
'
:
'
Your account is not activated. Please contact an administrator.
'
}
)
}
)
else
:
session
[
'
logged
'
]
=
True
session
[
'
session_id
'
]
=
str
(
uuid4
()
)
session
[
'
username
'
]
=
user
[
'
username
'
]
return
jsonify
(
{
'
error
'
:
False
,
'
logged
'
:
True
,
}
)
else
:
else
:
session
.
clear
()
session
.
clear
()
...
...
This diff is collapsed.
Click to expand it.
templates/login.html
+
6
−
2
View file @
01fc0451
...
@@ -64,12 +64,16 @@
...
@@ -64,12 +64,16 @@
{
{
if
(
!
data
.
error
)
if
(
!
data
.
error
)
{
{
if
(
data
.
logged
)
if
(
data
.
logged
)
{
{
location
.
href
=
"
{{ url_for( 'home' ) }}
"
;
location
.
href
=
"
{{ url_for( 'home' ) }}
"
;
}
else
{
}
else
{
$
(
'
#icnml_login_error
'
).
text
(
'
Invalid username/password
'
);
if
(
typeof
data
.
message
!==
'
undefined
'
)
var
message
=
data
.
message
;
else
var
message
=
'
Invalid username/password
'
;
$
(
'
#icnml_login_error
'
).
text
(
message
);
$
(
'
#login_button > span
'
).
text
(
"
Login
"
);
$
(
'
#login_button > span
'
).
text
(
"
Login
"
);
}
}
}
}
...
...
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