From fc7e80eb5c6e5f15c8670bb88caee1ed271f91f4 Mon Sep 17 00:00:00 2001 From: Diego Calvo Date: Mon, 15 Mar 2021 13:07:47 +0100 Subject: [PATCH] send email to manager if coop has no email --- products/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/views.py b/products/views.py index 03a750d..7566d2a 100644 --- a/products/views.py +++ b/products/views.py @@ -290,7 +290,7 @@ def purchase_email(request): return Response({"error": "Invalid value for product"}, status=status.HTTP_406_NOT_ACCEPTABLE) # check company.email if company.email is None: - return Response({"error": "Related compay has no contact email address"}, status=status.HTTP_406_NOT_ACCEPTABLE) + company.email = managing_user.email try: # send email to company company_message = render_to_string('purchase_notification_v2.html', {