From bcab2f9371d5036ad2a71c9d1e556a33fd057a97 Mon Sep 17 00:00:00 2001 From: Gowtham Sai <66207607+gowtham3105@users.noreply.github.com> Date: Tue, 20 Sep 2022 15:49:20 +0530 Subject: [PATCH] Only sending mails for accepted offers --- CDC_Backend/APIs/adminViews.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CDC_Backend/APIs/adminViews.py b/CDC_Backend/APIs/adminViews.py index 6a34875..e4f0cc2 100644 --- a/CDC_Backend/APIs/adminViews.py +++ b/CDC_Backend/APIs/adminViews.py @@ -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")