Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

52 email register not case sensitive #53

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)
from flask_mail import Mail, Message
import requests
from subscribie.signals import journey_complete
from subscribie.signals import signal_journey_complete
from subscribie.tasks import task_queue
from .forms import SignupForm
from subscribie.forms import LoginForm
Expand Down Expand Up @@ -58,7 +58,7 @@ def submit_new_site_build(
"""
payload = {}
payload["version"] = 1
payload["users"] = [form.email.data]
payload["users"] = [form.email.data.lower()]
payload["password"] = form.password.data
payload["login_token"] = login_token
company_name = form.company_name.data
Expand Down Expand Up @@ -133,16 +133,16 @@ def submit_new_site_build(

# Store new site in builder_sites table to allow logging in from subscribie site # noqa: E501
con = sqlite3.connect(app_config.get("DB_FULL_PATH"))
email = form.email.data
email = form.email.data.lower()
query = "INSERT INTO builder_sites (site_url, email) VALUES (?, ?)"
con.execute(query, (new_site_url, email.lower()))
con.execute(query, (new_site_url, email))
con.commit()


@builder.route("/start-building", methods=["POST"])
def save_plans():
form = SignupForm()
session["email"] = form.email.data
session["email"] = form.email.data.lower()
domain = app.config.get("SUBSCRIBIE_DOMAIN", ".subscriby.shop")
subdomain = create_subdomain_string(form.company_name.data)

Expand Down Expand Up @@ -182,7 +182,7 @@ def choose_package(sitename=None):
def journey_complete_subscriber(sender, **kw):
print("Journery Complete! Send an email or something..")
try:
email = kw["email"]
email = kw["email"].lower()
sender = app.config.get("MAIL_DEFAULT_SENDER", "hello@example.com")
login_url = session["login-url"]
msg = Message(
Expand Down Expand Up @@ -264,4 +264,4 @@ def getPlan(container, i, default=None):


# Subscribers
journey_complete.connect(journey_complete_subscriber)
signal_journey_complete.connect(journey_complete_subscriber)