Commit bf028a7c authored by John Red Medrano's avatar John Red Medrano

change condition on edit user

parent 9a7d171f
......@@ -176,14 +176,12 @@ class UserViewSet(viewsets.ModelViewSet):
Q(created_by_user__code=instance.code) |
Q(requested_to_user__code=instance.code)
)
print(instance.department.code)
print(request.data['department'])
if instance.department.code != request.data['department']:
if cms_form.count() > 0 or cms_template.count() > 0:
raise ParseError(
'Cannot delete this record the user has a record on change request it might cause a data error'
'Cannot update this record the user has a record on change request it might cause a data error'
)
......
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