-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'production' into develop
- Loading branch information
Showing
22 changed files
with
386 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -508,7 +508,10 @@ def external_login_handler(service): | |
|
||
user = da.authenticate_with_credentials(service, persistent_id) | ||
|
||
if user: | ||
if user and not user.validated: | ||
return "Du behöver gå en kurs och bli validerad först kontakta [email protected]" | ||
|
||
if user and user.validated: | ||
APP.logger.info( | ||
"Logging in user %s (%s - #%d) by persistent id %s for service %s, refferrer is %s" | ||
% ( | ||
|
@@ -538,7 +541,7 @@ def external_login_handler(service): | |
accountdetails["email"], | ||
None, | ||
username=accountdetails["username"], | ||
validated=True, | ||
validated=False, | ||
fullname=accountdetails["fullname"] if "fullname" in accountdetails else None, | ||
privileges=[ | ||
{"level": "viewer", "genebank": 1}, | ||
|
@@ -567,9 +570,6 @@ def external_login_handler(service): | |
% (persistent_id, accountdetails["email"], service) | ||
) | ||
|
||
# FIXME: this is how we "really" log in the user | ||
session["user_id"] = user.uuid | ||
|
||
# If we got a herd from external, setup ownership | ||
if "herd" in accountdetails: | ||
for h in ["G", "M"]: | ||
|
@@ -586,9 +586,13 @@ def external_login_handler(service): | |
else: | ||
APP.logger.warning("Could not find herd id for herd %s" % h.strip()) | ||
|
||
login_user(user) | ||
|
||
return redirect("/start") | ||
# FIXME: this is how we "really" log in the user | ||
if user.validated: | ||
session["user_id"] = user.uuid | ||
login_user(user) | ||
return redirect("/start") | ||
else: | ||
return "Du behöver gå en kurs och bli validerad först kontakta [email protected]" | ||
|
||
|
||
@APP.route("/api/link/<string:service>", methods=["GET", "POST"]) | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.