1👍
✅
Your .save()
method only calls the super().save()
in case the item is not created. You need to do that in both scenario’s, so:
class UserAccount(AbstractBaseUser, PermissionsMixin):
# …
def save(self, *args, **kwargs):
if not self.pk:
self.role = self.base_role
# not in if case
return super().save(*args, **kwargs)
Source:stackexchange.com