add is admin to manual creation user

This commit is contained in:
Cayo Puigdefabregas 2024-02-26 11:03:07 +01:00
parent 7be032bdc9
commit 3259c93bb7
2 changed files with 10 additions and 1 deletions

View File

@ -43,6 +43,15 @@
{{ object.email }} {{ object.email }}
</div> </div>
</div> </div>
{% if object.is_admin %}
<div class="row mt-3">
<div class="col-3">
{% trans "Is Admin" %}
</div>
<div class="col-9 text-secondary">
</div>
</div>
{% endif %}
</div> </div>
</div> </div>
</div> </div>

View File

@ -11,7 +11,7 @@ class ProfileForm(forms.ModelForm):
class Meta: class Meta:
model = User model = User
fields = ['first_name', 'last_name', 'email'] fields = ['first_name', 'last_name', 'email', 'is_admin']
def clean_first_name(self): def clean_first_name(self):
first_name = super().clean()['first_name'] first_name = super().clean()['first_name']