mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
Merge pull request #3301 from wwitzel3/release_3.0.2
remove last_name and first_name from admin_only fields
This commit is contained in:
commit
efa8496407
@ -1319,7 +1319,7 @@ class UserDetail(RetrieveUpdateDestroyAPIView):
|
||||
can_admin = request.user.can_access(User, 'admin', obj, request.data)
|
||||
|
||||
su_only_edit_fields = ('is_superuser', 'is_system_auditor')
|
||||
admin_only_edit_fields = ('last_name', 'first_name', 'username', 'is_active')
|
||||
admin_only_edit_fields = ('username', 'is_active')
|
||||
|
||||
fields_to_check = ()
|
||||
if not request.user.is_superuser:
|
||||
|
||||
@ -329,9 +329,9 @@ class UsersTest(BaseTest):
|
||||
detail_url = reverse('api:user_detail', args=(self.other_django_user.pk,))
|
||||
data = self.get(detail_url, expect=200, auth=self.get_other_credentials())
|
||||
|
||||
# can't change first_name, last_name, etc
|
||||
# can change first_name, last_name, etc
|
||||
data['last_name'] = "NewLastName"
|
||||
self.put(detail_url, data, expect=403, auth=self.get_other_credentials())
|
||||
self.put(detail_url, data, expect=200, auth=self.get_other_credentials())
|
||||
|
||||
# can't change username
|
||||
data['username'] = 'newUsername'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user