Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -133,6 +133,7 @@ def login():
|
|
133 |
# Fetch user details, including Reward_Points__c
|
134 |
query = f"SELECT Id, Name, Email__c, Reward_Points__c FROM Customer_Login__c WHERE Email__c='{email}' AND Password__c='{password}'"
|
135 |
result = sf.query(query)
|
|
|
136 |
|
137 |
if result["records"]:
|
138 |
user = result["records"][0]
|
@@ -170,6 +171,7 @@ def login():
|
|
170 |
else:
|
171 |
# If no record exists, create a new one
|
172 |
sf.Referral_Coupon__c.create({
|
|
|
173 |
"Referral_Email__c": email,
|
174 |
"Coupon_Code__c": new_coupon_code
|
175 |
})
|
|
|
133 |
# Fetch user details, including Reward_Points__c
|
134 |
query = f"SELECT Id, Name, Email__c, Reward_Points__c FROM Customer_Login__c WHERE Email__c='{email}' AND Password__c='{password}'"
|
135 |
result = sf.query(query)
|
136 |
+
referrer_name = referrer.get('Name')
|
137 |
|
138 |
if result["records"]:
|
139 |
user = result["records"][0]
|
|
|
171 |
else:
|
172 |
# If no record exists, create a new one
|
173 |
sf.Referral_Coupon__c.create({
|
174 |
+
"Name": referrer_name,
|
175 |
"Referral_Email__c": email,
|
176 |
"Coupon_Code__c": new_coupon_code
|
177 |
})
|