Skip to content

Commit

Permalink
Compare users case insensitive
Browse files Browse the repository at this point in the history
The users returned by Github and listed in our contributors.yml
are not equal regarding case sensitivity. That is why a case insensitive
comparison is required.
  • Loading branch information
beyhan committed Jan 12, 2024
1 parent db6c25e commit dacd3c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion org/org_user_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def _write_yaml_file(self, path, data):
def delete_inactive_contributors(self, users_to_delete):
path = f"{_SCRIPT_PATH}/contributors.yml"
contributors_yaml = self._load_yaml_file(path)
contributors_yaml["contributors"] = [c for c in contributors_yaml["contributors"] if c not in users_to_delete]
users_to_delete_lower = [user.lower() for user in users_to_delete]
contributors_yaml["contributors"] = [c for c in contributors_yaml["contributors"] if c.lower() not in users_to_delete_lower]
self._write_yaml_file(path, contributors_yaml)

def get_inactive_users_msg(self, users_to_delete, tagusers):
Expand Down

0 comments on commit dacd3c8

Please sign in to comment.