Commit b3dbea77 authored by Gladys Forte's avatar Gladys Forte

requested to user comp and dept details

parent 204faf4b
......@@ -43,7 +43,11 @@ class ChangeRequestTemplatesSerializer(
"username": instance.requested_to_user.username,
"code": instance.requested_to_user.code,
"email": instance.requested_to_user.email,
"contact_no": instance.requested_to_user.contact_no
"contact_no": instance.requested_to_user.contact_no,
"company_code": instance.requested_to_user.department.company.code,
"company_name": instance.requested_to_user.department.company.name,
"department_code": instance.requested_to_user.department.code,
"department_name": instance.requested_to_user.department.name
}
ret['requested_to_company'] = {
......
......@@ -52,6 +52,7 @@ class ChangeRequestList(serializers.ModelSerializer):
def to_representation(self, instance):
ret = super().to_representation(instance)
ret['company_name'] = instance.department.company.name
ret['company_code'] = instance.department.company.code
ret['department_code'] = instance.department.code
......
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