add is admin to manual creation user
This commit is contained in:
parent
7be032bdc9
commit
3259c93bb7
|
@ -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>
|
||||||
|
|
|
@ -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']
|
||||||
|
|
Loading…
Reference in New Issue