Commit 73ff6429 authored by John Red Medrano's avatar John Red Medrano

Merge pull request #338 in RMS/api-main-service from red-develop to RMSv2

* commit '3157af7b':
  added can_delete field on list of template to check if the instance can be delete or not
parents 1ad33691 3157af7b
......@@ -51,6 +51,7 @@ class ChangeRequestTemplatesSerializer(
ret['created_by'] = instance.created_by_user.name
return ret
except Exception as e:
ret['requested_to_company'] = "none"
......@@ -90,6 +91,22 @@ class ChangeRequestTemplatesSerializerList(
ret['department'] = instance.requested_to_department.name
ret['point_of_contact'] = instance.requested_to_user.name
ret['created_by'] = instance.created_by_user.name
child = models.ChangeRequestFormHeader.objects.filter(
template_no=instance.template_no
)
can_delete = ''
if child.count() > 0:
can_delete = False
else:
can_delete = True
ret['can_delete'] = can_delete
return ret
except Exception as e:
......
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