Commit 7e294b20 authored by John Red Medrano's avatar John Red Medrano

removed password on endpoint of user list on routing table and bug fix on template user list

parent d7cd4df2
......@@ -27,12 +27,7 @@ class UserListTemplate(APIView):
user_list = models.User.objects.filter(
code__in=verified_users
).annotate(
company_code=F('department__company__code'),
company_name=F('department__company__name'),
department_code=F('department__code'),
department_name=F('department__name')
).values()
)
print(user_list)
......
......@@ -50,6 +50,14 @@ class UserEditSerializer(serializers.ModelSerializer):
class ChangeRequestList(serializers.ModelSerializer):
def to_representation(self, instance):
ret = super().to_representation(instance)
ret['company_name'] = instance.department.company.code
ret['company_code'] = instance.department.company.name
ret['department_code'] = instance.department.code
ret['department_name'] = instance.department.name
return ret
class Meta:
model = User
fields = (
......
......@@ -16,7 +16,8 @@ class AdminAccountSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = '__all__'
# fields = '__all__'
read_only_fields = (
'created', 'createdby', 'modified', 'modifiedby', 'code',
)
exclude = ('password',)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment