Skip to content

Commit

Permalink
importgroups: fix call to validation function
Browse files Browse the repository at this point in the history
It returns a tuple rather than a single bool value.
  • Loading branch information
stsnel committed May 1, 2024
1 parent f85bf4e commit d20af4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## UNRELEASED

- Importgroups: fix issue where domain validation was not performed even if it had not been disabled
- Importgroups: fix issue where username validation results were not processed correctly.

## 2024-04-18 v1.1.1

Expand Down
4 changes: 2 additions & 2 deletions yclienttools/importgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ def _process_csv_line(line: dict, args: argparse.Namespace, yoda_version: str) -

for i in range(len(item_list)):
item_list[i] = item_list[i].strip().lower()
is_valid = yoda_names.is_valid_username(item_list[i], args.no_validate_domains)
is_valid, validation_message = yoda_names.is_valid_username(item_list[i], args.no_validate_domains)
if not is_valid:
return None, '"{}" is not a valid username.'.format(item_list[i])
return None, validation_message

if column_name.lower() == 'manager' or column_name.lower().startswith('manager:'):
managers.extend(item_list)
Expand Down

0 comments on commit d20af4a

Please sign in to comment.