Add staff and active settings for users.

This commit is contained in:
Christopher Charbonneau Wells 2017-12-11 17:44:02 -05:00
parent b34cc6aee8
commit 29e2a4af20
2 changed files with 9 additions and 3 deletions

View File

@ -11,13 +11,15 @@ from .models import Settings
class UserAddForm(UserCreationForm):
class Meta:
model = User
fields = ['username', 'first_name', 'last_name', 'email']
fields = ['username', 'first_name', 'last_name', 'email',
'is_staff', 'is_active']
class UserUpdateForm(forms.ModelForm):
class Meta:
model = User
fields = ['username', 'first_name', 'last_name', 'email']
fields = ['username', 'first_name', 'last_name', 'email',
'is_staff', 'is_active']
class UserForm(forms.ModelForm):

View File

@ -1,5 +1,5 @@
{% extends 'babybuddy/page.html' %}
{% load widget_tweaks static thumbnail %}
{% load bootstrap widget_tweaks %}
{% block title %}Users{% endblock %}
@ -18,6 +18,8 @@
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Staff</th>
<th>Active</th>
<th class="text-center">Actions</th>
</tr>
</thead>
@ -28,6 +30,8 @@
<td>{{ object.first_name }}</td>
<td>{{ object.last_name }}</td>
<td>{{ object.email }}</td>
<td>{{ object.is_staff|bool_icon }}</td>
<td>{{ object.is_active|bool_icon }}</td>
<td class="text-center">
<div class="btn-group btn-group-sm" role="group" aria-label="Actions">