no need to notify admin when someone uses a coupon

This commit is contained in:
Son 2022-05-15 19:57:45 +02:00
parent 34ad81c7c0
commit 54e78786b0
1 changed files with 1 additions and 14 deletions

View File

@ -4,10 +4,9 @@ from flask_login import login_required, current_user
from flask_wtf import FlaskForm from flask_wtf import FlaskForm
from wtforms import StringField, validators from wtforms import StringField, validators
from app.config import ADMIN_EMAIL, PADDLE_VENDOR_ID, PADDLE_COUPON_ID from app.config import PADDLE_VENDOR_ID, PADDLE_COUPON_ID
from app.dashboard.base import dashboard_bp from app.dashboard.base import dashboard_bp
from app.db import Session from app.db import Session
from app.email_utils import send_email
from app.log import LOG from app.log import LOG
from app.models import ( from app.models import (
ManualSubscription, ManualSubscription,
@ -98,18 +97,6 @@ def coupon_route():
"success", "success",
) )
# notify admin
if coupon.is_giveaway:
subject = f"User {current_user} applies a (free) coupon"
else:
subject = f"User {current_user} applies a (paid, {coupon.comment or ''}) coupon"
send_email(
ADMIN_EMAIL,
subject=subject,
plaintext="",
html="",
)
return redirect(url_for("dashboard.index")) return redirect(url_for("dashboard.index"))
else: else: