Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
9e12138a
Commit
9e12138a
authored
Dec 04, 2012
by
Kostas Papadimitriou
Browse files
Automatic local auth provider assignment
when a valid user with empty authentication providers list tries to log in
parent
4d1021bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/target/local.py
View file @
9e12138a
...
@@ -102,7 +102,12 @@ def login(request, on_failure='im/login.html'):
...
@@ -102,7 +102,12 @@ def login(request, on_failure='im/login.html'):
message
=
msg
+
msg_extra
message
=
msg
+
msg_extra
elif
not
user
.
can_login_with_auth_provider
(
'local'
):
elif
not
user
.
can_login_with_auth_provider
(
'local'
):
message
=
_
(
astakos_messages
.
NO_LOCAL_AUTH
)
# valid user logged in with no auth providers set, add local provider
# and let him log in
if
user
.
auth_providers
.
count
()
==
0
:
user
.
add_auth_provider
(
'local'
)
else
:
message
=
_
(
astakos_messages
.
NO_LOCAL_AUTH
)
if
message
:
if
message
:
messages
.
error
(
request
,
message
)
messages
.
error
(
request
,
message
)
...
...
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