Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
d42718c3
Commit
d42718c3
authored
Jun 14, 2017
by
marcel
Browse files
Prevent race conditions on register.
parent
f8078d94
Changes
2
Hide whitespace changes
Inline
Side-by-side
vispa/controller/ajax.py
View file @
d42718c3
...
...
@@ -52,13 +52,14 @@ class AjaxController(AbstractController):
user_group
=
Group
.
get_or_create_by_name
(
session
,
user_group
)
user_group
.
add_user
(
session
,
user
,
Group_User_Assoc
.
CONFIRMED
)
hash
=
None
if
vispa
.
config
(
"web"
,
"registration.autoactive"
,
True
):
return
{
"
hash
"
:
user
.
hash
}
hash
=
user
.
hash
elif
vispa
.
config
(
"web"
,
"registration.sendmail"
,
False
):
User
.
send_registration_mail
(
user
.
name
,
user
.
email
,
user
.
hash
)
return
{
"hash"
:
None
}
return
{
"hash"
:
hash
}
@
cherrypy
.
expose
@
cherrypy
.
tools
.
user
(
on
=
False
)
...
...
vispa/static/js/login.js
View file @
d42718c3
...
...
@@ -105,7 +105,9 @@ define([
$
(
"
#register-name
"
).
focus
();
}
else
{
if
(
res
.
data
.
hash
)
{
window
.
location
.
href
=
self
.
url
.
dynamic
(
"
password/
"
+
res
.
data
.
hash
);
setTimeout
(
function
()
{
window
.
location
.
href
=
self
.
url
.
dynamic
(
"
password/
"
+
res
.
data
.
hash
);
},
1000
);
}
else
{
$
(
"
#register-success
"
).
fadeIn
(
100
);
setTimeout
(
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment