Commit 8a1d1afe authored by Gladys Forte's avatar Gladys Forte

update action completed

parent 395bd942
......@@ -785,9 +785,21 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
form_code=form_code
).update(status='Completed')
else:
models.ChangeRequestFormHeader.objects.filter(
form_code=form_code
).update(status='Approved')
the_next_vendor = models.ChangeRequestFormApprovers.objects.filter(
form_code=form_code, level=int(next_level),
delegation='Vendor/Implementor'
).first()
if the_next_vendor:
if the_next_vendor.user.code == the_last_vendor.user.code:
models.ChangeRequestFormHeader.objects.filter(
form_code=form_code
).update(status='Approved')
else:
models.ChangeRequestFormHeader.objects.filter(
form_code=form_code
).update(status='Pending')
elif action.lower() == 'acknowledged':
......
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