MCPcopy Index your code
hub / github.com/Flagsmith/flagsmith / create_superuser

Method create_superuser

api/users/models.py:95–105  ·  view source on GitHub ↗

Create and save a SuperUser with the given email and password.

(self, email, password, **extra_fields)

Source from the content-addressed store, hash-verified

93 return self._create_user(email, password, **extra_fields) # type: ignore[no-untyped-call]
94
95 def create_superuser(self, email, password, **extra_fields): # type: ignore[no-untyped-def]
96 """Create and save a SuperUser with the given email and password."""
97 extra_fields.setdefault("is_staff", True)
98 extra_fields.setdefault("is_superuser", True)
99
100 if extra_fields.get("is_staff") is not True:
101 raise ValueError("Superuser must have is_staff=True.")
102 if extra_fields.get("is_superuser") is not True:
103 raise ValueError("Superuser must have is_superuser=True.")
104
105 return self._create_user(email, password, **extra_fields) # type: ignore[no-untyped-call]
106
107 def get_by_natural_key(self, email): # type: ignore[no-untyped-def]
108 # Used to allow case insensitive login

Callers 3

create_initial_superuserFunction · 0.80
superuserFunction · 0.80
superuserFunction · 0.80

Calls 2

_create_userMethod · 0.95
getMethod · 0.45

Tested by 2

superuserFunction · 0.64
superuserFunction · 0.64