Verified Commit 33e6d2a6 authored by Peter Stanko's avatar Peter Stanko
Browse files

Adding user even if the user exists when importing

parent f730c9bc
Pipeline #17057 passed with stage
in 8 minutes and 30 seconds
......@@ -193,8 +193,10 @@ class DataManagement(object):
users = self._parse_csv_users(file)
created_users = []
for user in users:
if self.rest.find.user(user['username'], throws=False):
found_user = self.rest.find.user(user['username'], throws=False)
if found_user:
log.debug(f"[IMPORT] skipping already existing user {user['username']}: {user}")
created_users.append(found_user)
continue
log.debug(f"[IMPORT] Adding user {user['username']}: {user}")
created = self.rest.users.create(**user, admin=False)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment