I must admit that we don’t really do a great job of documenting how it’s supposed to work. So I’m going to refer to how we create the data initially:
The reset command has a side effect of creating the user:
There you can see it should indeed be a superuser. I don’t know how the user could have changed to false.
To change it, I’d suggest to open a console with PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager shell and then run:
from django.contrib.auth import get_user_model
user = user_model.objects.get(username='admin')
user.is_superuser = True
user.save()
(Yes, that you need to set the env var is kind of stupid but upstream hasn’t been very open to prescribing a default layout and at least for now we ship pure upstream code)
>>> from django.contrib.auth import get_user_model
>>> user = user_model.objects.get(username='admin')
Traceback (most recent call last):
File "<console>", line 1, in <module>
NameError: name 'user_model' is not defined
I don’t mind changing it directly in the database. I know my SQL. Or is the pulp shell doing more than changing the database?
Oh, I missed a user_model = get_user_model() in there. I may need more caffeine.
I honestly don’t know exactly. Django does implement signals so it is possible to hook into changes on models. If Pulp is using those, you may miss them. That’s why I suggested the Python approach.