diff --git a/app/dao/users_dao.py b/app/dao/users_dao.py index 8180e6f11..7b2f2e609 100644 --- a/app/dao/users_dao.py +++ b/app/dao/users_dao.py @@ -36,7 +36,6 @@ def get_login_gov_user(login_uuid, email_address): should be removed. """ - print(User.query.filter_by(login_uuid=login_uuid).first()) user = User.query.filter_by(login_uuid=login_uuid).first() if user: if user.email_address != email_address: diff --git a/app/user/rest.py b/app/user/rest.py index 2cbbb9b25..3ebca90ed 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -566,6 +566,9 @@ def get_user_login_gov_user(): login_uuid = request_args["login_uuid"] email = request_args["email"] user = get_login_gov_user(login_uuid, email) + + if user is None: + return jsonify({}) result = user.serialize() return jsonify(data=result) @@ -715,9 +718,9 @@ def get_orgs_and_services(user): "id": service.id, "name": service.name, "restricted": service.restricted, - "organization": service.organization.id - if service.organization - else None, + "organization": ( + service.organization.id if service.organization else None + ), } for service in user.services if service.active