Only sending mails for accepted offers

This commit is contained in:
Gowtham Sai 2022-09-20 15:49:20 +05:30
parent 75f7afd151
commit bcab2f9371
1 changed files with 2 additions and 1 deletions

View File

@ -115,7 +115,8 @@ def updateOfferAccepted(request, id, email, user_type):
opening.offer_accepted = offer_accepted == "true"
opening.changed_by = get_object_or_404(User, id=id)
opening.save()
send_opening_notifications(opening.id)
if opening.offer_accepted:
send_opening_notifications(opening.id)
else:
raise ValueError("Offer Status already updated")