2
The error occurs here:
user = self.create_user(email, password=password)
This method saves the newly created user with organization
set to None
. Move the checking and assigning of an organization from the create_superuser()
into the create_user()
.
Source:stackexchange.com