From 664859dd26f76ff55cb9b04452621fc06eded9fb Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 23 Jan 2020 03:11:37 +0000 Subject: [PATCH] Only allow admins to change member's names --- apiserver/apiserver/api/serializers.py | 2 ++ apiserver/docs/source/api.rst | 4 ++-- webclient/src/Account.js | 15 --------------- webclient/src/Admin.js | 13 +++++++++++++ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apiserver/apiserver/api/serializers.py b/apiserver/apiserver/api/serializers.py index f1777e5..53b2a89 100644 --- a/apiserver/apiserver/api/serializers.py +++ b/apiserver/apiserver/api/serializers.py @@ -103,6 +103,8 @@ class MemberSerializer(serializers.ModelSerializer): 'is_director', 'is_staff', 'is_instructor', + 'first_name', + 'last_name', 'status', 'expire_date', 'current_start_date', diff --git a/apiserver/docs/source/api.rst b/apiserver/docs/source/api.rst index 975c60c..06f5d47 100644 --- a/apiserver/docs/source/api.rst +++ b/apiserver/docs/source/api.rst @@ -287,8 +287,6 @@ Edit Member Details :json postal_code: :json boolean set_details: Set true if they've filled out the new member form on sign up so the UI stops showing it. - :json first_name: - :json last_name: :json preferred_name: What's shown throughout the UI. :json emergency_contact_name: optional :json emergency_contact_phone: optional @@ -300,6 +298,8 @@ Edit Member Details Can modify any member. Above fields, plus: + :json first_name: + :json last_name: :json boolean is_director: Grants admin privileges to member. :json boolean is_staff: Same as director, just not named one. :json boolean is_instructor: Able to create and edit courses and sessions. diff --git a/webclient/src/Account.js b/webclient/src/Account.js index 1dab643..2b8c071 100644 --- a/webclient/src/Account.js +++ b/webclient/src/Account.js @@ -107,21 +107,6 @@ export function AccountForm(props) {
Member Details
- - - - -
Edit Member Details
+ + + + +