[organization] First user or single user org as org admin
@@ -170,8 +170,8 @@ def create_user(username, password, is_superuser=True):
user.set_password(password)
if ENABLE_ORGANIZATIONS.get():
- user.is_admin = is_superuser
- user.is_superuser = User.objects.exists()
+ user.is_admin = is_superuser or not organization.organizationuser_set.exists()
+ user.is_superuser = not User.objects.exists()
else:
user.is_superuser = is_superuser
