Commit 2d3352db authored by Gladys Forte's avatar Gladys Forte

Merge pull request #107 in RMS/api-main-service from gladys-dev2 to RMSv2

* commit 'b2ac4549':
  migrations
parents bd38fdb9 b2ac4549
......@@ -440,6 +440,11 @@ class ChangeRequestFormsViewset(meviewsets.ModelViewSet):
level = request.data['level']
next_level = int(request.data['level']) + 1
remarks = request.data['remarks']
models.ChangeRequestFormApprovers.objects.filter(
pk=id).update(action=action,
remarks=remarks,
action_date=datetime.now())
next_approver = models.ChangeRequestFormApprovers.objects.filter(
level=str(next_level),
......@@ -450,16 +455,16 @@ class ChangeRequestFormsViewset(meviewsets.ModelViewSet):
# NOTIF MSG FOR REQUESTOR
requestor_notification_msg = REQUESTOR_MESSAGE.split(';')[0]
# NOTIF MSG FOR APPROVER
# NOTIF MSG FOR NEXT APPROVER
notification_msg = APPROVER_MESSAGE.split(';')[0]
# SEND EMAIL AND NOTIF TO REQUESTOR
send_mail_requestor(
current_user, form_code, delegation,
requestor_notification_msg, action,
remarks, level
)
print("level 3")
for n_approver in next_approver:
print(n_approver.user)
......
......@@ -316,7 +316,7 @@ def send_mail_requestor(current_user,
current_user)
def next_approver_email(receiver, form_code, delegation, msg, action, code):
def next_approver_email(receiver, form_code, delegation, msg, action):
cr_link = f'{CR_FRONT_LINK}/{form_code}'
template_instance = get_template_instance(form_code)
app = 'cms'
......
# Generated by Django 2.2 on 2019-09-17 17:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='changerequestformapprovers',
name='action_date',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='changerequesthistory',
name='action',
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name='changerequesthistory',
name='entity',
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name='notification',
name='account_no',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='notification',
name='app',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='notification',
name='form_code',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='notification',
name='sender_account_no',
field=models.CharField(blank=True, max_length=255, null=True),
),
]
......@@ -741,6 +741,9 @@ class ChangeRequestFormApprovers(BaseApprover):
max_length=50,
blank=True,
null=True)
action_date = models.DateTimeField(
blank=True,
null=True)
date_sent = models.DateTimeField(
blank=True,
null=True)
......
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