Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,13 +19,16 @@ sheet = gc.open_by_key(SHEET_ID)
|
|
19 |
|
20 |
def verify_username(username):
|
21 |
"""Verify if username exists in user form"""
|
|
|
|
|
|
|
22 |
try:
|
23 |
user_sheet = sheet.worksheet('Users')
|
24 |
usernames = user_sheet.col_values(2) # Assuming username is in column B
|
25 |
is_valid = username in usernames
|
26 |
|
27 |
return {
|
28 |
-
username_output:
|
29 |
inquiry_section: gr.update(visible=is_valid)
|
30 |
}
|
31 |
except Exception as e:
|
|
|
19 |
|
20 |
def verify_username(username):
|
21 |
"""Verify if username exists in user form"""
|
22 |
+
scri= '''Hello, this is [Your Name] from YLsourcing. Does your company currently have any procurement plans?
|
23 |
+
|
24 |
+
We’d love to offer you a free recommendation of the best direct suppliers in China, tailored to your needs. Would that be helpful for you?'''
|
25 |
try:
|
26 |
user_sheet = sheet.worksheet('Users')
|
27 |
usernames = user_sheet.col_values(2) # Assuming username is in column B
|
28 |
is_valid = username in usernames
|
29 |
|
30 |
return {
|
31 |
+
username_output: scri if is_valid else "Invalid username",
|
32 |
inquiry_section: gr.update(visible=is_valid)
|
33 |
}
|
34 |
except Exception as e:
|