Merge "Remove self from group after group creation"
diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py
index 7d85e95..2c19c3a 100644
--- a/jeepyb/cmd/manage_projects.py
+++ b/jeepyb/cmd/manage_projects.py
@@ -209,6 +209,11 @@
if group in GERRIT_SYSTEM_GROUPS:
return GERRIT_SYSTEM_GROUPS[group]
gerrit.createGroup(group)
+ for user in gerrit.listMembers(group):
+ if gerrit.username == user['username']:
+ # Gerrit now adds creating user to groups. We don't want that.
+ gerrit.removeMember(group, gerrit.username)
+ break
uuid = _get_group_uuid(group)
if uuid:
return uuid