diff --git a/invites/views.py b/invites/views.py index fa1c579a1..b7cb11760 100644 --- a/invites/views.py +++ b/invites/views.py @@ -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( @@ -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 diff --git a/landing/views.py b/landing/views.py index 900a4a5d6..140c3db39 100644 --- a/landing/views.py +++ b/landing/views.py @@ -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() @@ -138,7 +138,6 @@ def godmode_invite(request): text=f"🎁 Юзеру '{email}' продлили аккаунт за донат", ) - return render(request, "message.html", { "title": "🎁 Юзер приглашен", "message": f"Сейчас он получит на почту '{email}' уведомление об этом. " diff --git a/payments/views/stripe.py b/payments/views/stripe.py index 4ded8d6b0..68720ce0b 100644 --- a/payments/views/stripe.py +++ b/payments/views/stripe.py @@ -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