Skip to content

Commit 34d1810

Browse files
committed
long rebate email fix
1 parent 5e9220c commit 34d1810

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

home/signals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ def update_long_bill(sender, instance: LongRebate, **kwargs):
105105
logger.info("Signal called for Updating Long Rebate")
106106
try:
107107
old_instance = LongRebate.objects.get(pk=instance.pk)
108-
reason = instance.reason if instance.reason is not None else "No reason"
109-
logger.info(instance.approved, reason)
108+
reason = instance.reason if instance.reason else "No reason"
109+
logger.info(f"Approved: {instance.approved}, Reason: {reason}")
110110
if (
111111
old_instance.approved != instance.approved
112112
or old_instance.reason != instance.reason

home/utils/django_email_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def long_rebate_mail(
9999
# elif(1):
100100
# message = message_long_rebate.format(start_date=start_date, end_date=end_date, approved = "rejected",added="added to")
101101
else:
102-
rejected_message = (
103-
"Your rebate is not approved for the following reason: " + reason
104-
)
102+
rejected_message = "Your rebate is not approved."
103+
if reason:
104+
rejected_message = "Reason: " + reason
105105
message = message_long_rebate.format(
106106
start_date=start_date,
107107
end_date=end_date,

0 commit comments

Comments
 (0)