mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
Merge pull request #881 from GSA/debug_staging
return None to handle new user
This commit is contained in:
@@ -36,7 +36,6 @@ def get_login_gov_user(login_uuid, email_address):
|
|||||||
should be removed.
|
should be removed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
print(User.query.filter_by(login_uuid=login_uuid).first())
|
|
||||||
user = User.query.filter_by(login_uuid=login_uuid).first()
|
user = User.query.filter_by(login_uuid=login_uuid).first()
|
||||||
if user:
|
if user:
|
||||||
if user.email_address != email_address:
|
if user.email_address != email_address:
|
||||||
|
|||||||
@@ -566,6 +566,9 @@ def get_user_login_gov_user():
|
|||||||
login_uuid = request_args["login_uuid"]
|
login_uuid = request_args["login_uuid"]
|
||||||
email = request_args["email"]
|
email = request_args["email"]
|
||||||
user = get_login_gov_user(login_uuid, email)
|
user = get_login_gov_user(login_uuid, email)
|
||||||
|
|
||||||
|
if user is None:
|
||||||
|
return jsonify({})
|
||||||
result = user.serialize()
|
result = user.serialize()
|
||||||
return jsonify(data=result)
|
return jsonify(data=result)
|
||||||
|
|
||||||
@@ -715,9 +718,9 @@ def get_orgs_and_services(user):
|
|||||||
"id": service.id,
|
"id": service.id,
|
||||||
"name": service.name,
|
"name": service.name,
|
||||||
"restricted": service.restricted,
|
"restricted": service.restricted,
|
||||||
"organization": service.organization.id
|
"organization": (
|
||||||
if service.organization
|
service.organization.id if service.organization else None
|
||||||
else None,
|
),
|
||||||
}
|
}
|
||||||
for service in user.services
|
for service in user.services
|
||||||
if service.active
|
if service.active
|
||||||
|
|||||||
Reference in New Issue
Block a user