Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,6 +62,13 @@ def signup():
|
|
62 |
try:
|
63 |
ref = 0 # Default reward points for new user
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
# Check if a referral code is entered
|
66 |
if referral_code:
|
67 |
# Query Salesforce to check if the referral code exists
|
@@ -122,6 +129,7 @@ def signup():
|
|
122 |
|
123 |
|
124 |
|
|
|
125 |
@app.route("/login", methods=["GET", "POST"])
|
126 |
def login():
|
127 |
if request.method == "POST":
|
|
|
62 |
try:
|
63 |
ref = 0 # Default reward points for new user
|
64 |
|
65 |
+
# Check if the email already exists in Salesforce
|
66 |
+
email_query = f"SELECT Id FROM Customer_Login__c WHERE Email__c = '{email}'"
|
67 |
+
email_result = sf.query(email_query)
|
68 |
+
|
69 |
+
if email_result["records"]:
|
70 |
+
return render_template("signup.html", error="Email already in use! Please use a different email.")
|
71 |
+
|
72 |
# Check if a referral code is entered
|
73 |
if referral_code:
|
74 |
# Query Salesforce to check if the referral code exists
|
|
|
129 |
|
130 |
|
131 |
|
132 |
+
|
133 |
@app.route("/login", methods=["GET", "POST"])
|
134 |
def login():
|
135 |
if request.method == "POST":
|