From a1b067fcbb7219ac1a148de0e3ffa70d3dbb8849 Mon Sep 17 00:00:00 2001 From: Matt Craddock Date: Thu, 28 Nov 2024 12:09:50 +0000 Subject: [PATCH] Update data_safe_haven/commands/users.py Co-authored-by: Jim Madge --- data_safe_haven/commands/users.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data_safe_haven/commands/users.py b/data_safe_haven/commands/users.py index b3a90c0664..661e3e91f0 100644 --- a/data_safe_haven/commands/users.py +++ b/data_safe_haven/commands/users.py @@ -153,8 +153,7 @@ def register( } usernames_to_register = [] for username in usernames: - if username in user_dict.keys(): - user_domain = user_dict[username] + if user_domain:=user_dict.get(username) if shm_config.shm.fqdn not in user_domain: logger.error( f"User [green]'{username}'[/green]'s principal domain name is [blue]'{user_domain}'[/blue].\n"