From 1d5ae191b5da9cd0bc9f800d0a4cf4f65518a5e2 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 15 Dec 2022 20:53:40 +0000 Subject: Fix bug where changing a resource owner throws an error due to users without email_addresses (can happen for orcid/github users currently) --- wqflask/wqflask/resource_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wqflask/wqflask/resource_manager.py b/wqflask/wqflask/resource_manager.py index c0717314..91731a4a 100644 --- a/wqflask/wqflask/resource_manager.py +++ b/wqflask/wqflask/resource_manager.py @@ -163,7 +163,7 @@ def search_user(resource_id: str): user = json.loads(users[user]) for q in (request.form.get("user_name"), request.form.get("user_email")): - if q and (q in user.get("email_address") or - q in user.get("full_name")): + if q and (q in user.get("email_address", "") or + q in user.get("full_name", "")): results[user.get("user_id", "")] = user return json.dumps(tuple(results.values())) -- cgit v1.2.3