Add option to make someone portal staff
This commit is contained in:
parent
579966e7aa
commit
c22a19736d
|
@ -27,6 +27,7 @@ class Member(models.Model):
|
|||
postal_code = models.CharField(max_length=16, null=True)
|
||||
|
||||
is_director = models.BooleanField(default=False)
|
||||
is_staff = models.BooleanField(default=False)
|
||||
is_instructor = models.BooleanField(default=False)
|
||||
status = models.CharField(max_length=32, blank=True, null=True)
|
||||
expire_date = models.DateField(default=date.today, null=True)
|
||||
|
|
|
@ -81,6 +81,7 @@ class MemberSerializer(serializers.ModelSerializer):
|
|||
read_only_fields = [
|
||||
'id',
|
||||
'is_director',
|
||||
'is_staff',
|
||||
'is_instructor',
|
||||
'status',
|
||||
'expire_date',
|
||||
|
|
|
@ -15,7 +15,7 @@ class AllowMetadata(BasePermission):
|
|||
return request.method in ['OPTIONS', 'HEAD']
|
||||
|
||||
def is_admin_director(user):
|
||||
return user.is_staff or user.member.is_director
|
||||
return user.is_staff or user.member.is_director or user.member.is_staff
|
||||
|
||||
class IsOwnerOrAdmin(BasePermission):
|
||||
def has_object_permission(self, request, view, obj):
|
||||
|
|
|
@ -87,6 +87,16 @@ export function AdminMemberForm(props) {
|
|||
/>
|
||||
</Form.Field>
|
||||
|
||||
<Form.Field>
|
||||
<label>Is the member portal staff?</label>
|
||||
<Checkbox
|
||||
label='Yes'
|
||||
name='is_staff'
|
||||
onChange={handleCheck}
|
||||
checked={input.is_staff}
|
||||
/>
|
||||
</Form.Field>
|
||||
|
||||
<Form.Field>
|
||||
<label>Is the member an instructor?</label>
|
||||
<Checkbox
|
||||
|
@ -134,10 +144,6 @@ export function AdminMemberInfo(props) {
|
|||
<Table.Cell>{member.status}</Table.Cell>
|
||||
</Table.Row>
|
||||
|
||||
<Table.Row>
|
||||
<Table.Cell>Email:</Table.Cell>
|
||||
<Table.Cell>{member.email}</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
<Table.Cell>Phone:</Table.Cell>
|
||||
<Table.Cell>{member.phone}</Table.Cell>
|
||||
|
@ -171,11 +177,11 @@ export function AdminMemberInfo(props) {
|
|||
|
||||
<Table.Row>
|
||||
<Table.Cell>Emergency Contact Name:</Table.Cell>
|
||||
<Table.Cell>{member.emergency_contact_name}</Table.Cell>
|
||||
<Table.Cell>{member.emergency_contact_name || 'None'}</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
<Table.Cell>Emergency Contact Phone:</Table.Cell>
|
||||
<Table.Cell>{member.emergency_contact_phone}</Table.Cell>
|
||||
<Table.Cell>{member.emergency_contact_phone || 'None'}</Table.Cell>
|
||||
</Table.Row>
|
||||
</Table.Body>
|
||||
</BasicTable>
|
||||
|
|
Loading…
Reference in New Issue
Block a user