Skip to content

Commit

Permalink
fix: lower emails
Browse files Browse the repository at this point in the history
  • Loading branch information
vas3k committed Dec 27, 2024
1 parent 9d8edf3 commit 8fcbdf9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion invites/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def activate_invite(request, invite_code):

# create or find existing user
now = datetime.utcnow()
email = email.lower().strip()
user, _ = User.objects.get_or_create(
email=email,
defaults=dict(
Expand All @@ -84,7 +85,7 @@ def activate_invite(request, invite_code):
)

# activate subscription
club_subscription_activator(PRODUCTS["club1_invite"], invite.payment, user)
club_subscription_activator(PRODUCTS[invite.payment.product_code], invite.payment, user)

# expire the invite
invite.used_at = now
Expand Down
3 changes: 1 addition & 2 deletions landing/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def godmode_invite(request):
if request.method == "POST":
form = GodmodeInviteForm(request.POST, request.FILES)
if form.is_valid():
email = form.cleaned_data["email"]
email = form.cleaned_data["email"].lower().strip()
days = form.cleaned_data["days"]
now = datetime.utcnow()

Expand Down Expand Up @@ -138,7 +138,6 @@ def godmode_invite(request):
text=f"🎁 <b>Юзеру '{email}' продлили аккаунт за донат</b>",
)


return render(request, "message.html", {
"title": "🎁 Юзер приглашен",
"message": f"Сейчас он получит на почту '{email}' уведомление об этом. "
Expand Down
2 changes: 1 addition & 1 deletion payments/views/stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def pay(request):
# parse email
email = request.GET.get("email") or ""
if email:
email = email.lower()
email = email.lower().strip()

# who's paying?
if not request.me: # scenario 1: new user
Expand Down

0 comments on commit 8fcbdf9

Please sign in to comment.