Commit b4668f59 authored by Gladys Forte's avatar Gladys Forte

history added on_behalf

parent eba39661
......@@ -708,7 +708,20 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
self.perform_update(serializer)
new_instance = serializer.data
original_user = new_instance['user']['code']
if original_user == current_user:
data_update = {
"on_behalf": None
}
else:
data_update = {
"on_behalf": current_user
}
new_instance = {**new_instance, **data_update}
crhistory_save(
batchno,
enums.CREnum.ACTION.value,
......@@ -1063,7 +1076,7 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
"date_sent" : convert['date_sent'],
"delegation" : convert['delegation'],
"action" : convert['action'],
"remarks" : convert['remarks'],
"remarks" : convert['remarks'] & convert['on_behalf'],
"created": convert['action_date']
}
......
......@@ -71,21 +71,6 @@ from django.core.files.base import ContentFile
from django.conf import settings
from io import BytesIO
from django.http import HttpResponse
from xhtml2pdf import pisa
config = configparser.ConfigParser()
config_file = os.path.join('./', 'env.ini')
config.read(config_file)
APPROVER_MESSAGE = settings.APPROVER_MESSAGE
REQUESTOR_MESSAGE = settings.REQUESTOR_MESSAGE
REQUESTOR_REJECT_MESSAGE = settings.REQUESTOR_REJECT_MESSAGE
VENDOR_ACKNOWLEDGE_MESSAGE = settings.VENDOR_ACKNOWLEDGE_MESSAGE
REQUESTOR_ACKNOWLEDGE_MESSAGE = settings.REQUESTOR_ACKNOWLEDGE_MESSAGE
REQUESTOR_COMPLETION_MESSAGE = settings.REQUESTOR_COMPLETION_MESSAGE
VENDOR_ACCEPTANCE_MESSAGE = settings.VENDOR_ACCEPTANCE_MESSAGE
VENDOR_REJECT_MESSAGE = settings.VENDOR_REJECT_MESSAGE
class ChangeRequestFormsViewset(viewsets.ModelViewSet):
......
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