From 6a4797aaf9665086149638eb38755bafefb840b1 Mon Sep 17 00:00:00 2001 From: Beyhan Veli Date: Mon, 5 May 2025 10:04:57 +0200 Subject: [PATCH 1/2] Support multiple orgs in inactive user deletion With the [change](https://github.com/cloudfoundry/community/commit/208be3b2ebb453d2e827fa3bc25b9aef54f3849e) we introduced multiple org support to cloudfoundry/community/orgs/contributors.yml. This change adapts the inactive user deletion to work with the new structure of cloudfoundry/community//orgs/contributors.yml. --- orgs/org_user_management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orgs/org_user_management.py b/orgs/org_user_management.py index 60d9038dc..843285808 100644 --- a/orgs/org_user_management.py +++ b/orgs/org_user_management.py @@ -101,7 +101,7 @@ def delete_inactive_contributors(self, users_to_delete): path = f"{_SCRIPT_PATH}/contributors.yml" contributors_yaml = self._load_yaml_file(path) 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] + contributors_yaml["orgs"][self.github_org]["contributors"] = [c for c in contributors_yaml["orgs"][self.github_org]["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, inactive_users_by_wg, tagusers): From 35b5284aab9d8a95a3e5c8488444578dc9d1cc25 Mon Sep 17 00:00:00 2001 From: Beyhan Veli Date: Mon, 5 May 2025 11:57:09 +0200 Subject: [PATCH 2/2] Fix flake8 formating issue --- orgs/org_user_management.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/orgs/org_user_management.py b/orgs/org_user_management.py index 843285808..e170a3bb3 100644 --- a/orgs/org_user_management.py +++ b/orgs/org_user_management.py @@ -101,7 +101,9 @@ def delete_inactive_contributors(self, users_to_delete): path = f"{_SCRIPT_PATH}/contributors.yml" contributors_yaml = self._load_yaml_file(path) users_to_delete_lower = [user.lower() for user in users_to_delete] - contributors_yaml["orgs"][self.github_org]["contributors"] = [c for c in contributors_yaml["orgs"][self.github_org]["contributors"] if c.lower() not in users_to_delete_lower] + contributors_yaml["orgs"][self.github_org]["contributors"] = [ + c for c in contributors_yaml["orgs"][self.github_org]["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, inactive_users_by_wg, tagusers):