Преглед изворни кода

HUE-8530 [organization] Make user superuser only explicitly

Romain пре 5 година
родитељ
комит
4c347cc76c
1 измењених фајлова са 2 додато и 3 уклоњено
  1. 2 3
      desktop/core/src/desktop/auth/backend.py

+ 2 - 3
desktop/core/src/desktop/auth/backend.py

@@ -171,9 +171,8 @@ def create_user(username, password, is_superuser=True):
 
   if ENABLE_ORGANIZATIONS.get():
     user.is_admin = is_superuser or not organization.organizationuser_set.exists() or not organization.is_multi_user
-    user.is_superuser = not User.objects.exists()
-  else:
-    user.is_superuser = is_superuser
+
+  user.is_superuser = is_superuser
 
   user.save()