Spaces:
Sleeping
Sleeping
update
Browse files
utils.py
CHANGED
|
@@ -150,6 +150,7 @@ def append_to_sheet(user_data=None, custom_row_dict=None, custom_sheet_name=None
|
|
| 150 |
# Try to open the spreadsheet by name
|
| 151 |
spreadsheet = client.open(custom_sheet_name)
|
| 152 |
is_new = False
|
|
|
|
| 153 |
except SpreadsheetNotFound:
|
| 154 |
# If it doesn't exist, create it
|
| 155 |
spreadsheet = client.create(custom_sheet_name)
|
|
@@ -157,7 +158,7 @@ def append_to_sheet(user_data=None, custom_row_dict=None, custom_sheet_name=None
|
|
| 157 |
spreadsheet.share('shanghuagao@gmail.com', perm_type='user', role='writer')
|
| 158 |
spreadsheet.share('rzhu@college.harvard.edu', perm_type='user', role='writer')
|
| 159 |
is_new = True
|
| 160 |
-
|
| 161 |
print("Spreadsheet ID:", spreadsheet.id)
|
| 162 |
# Access the first worksheet
|
| 163 |
sheet = spreadsheet.sheet1
|
|
|
|
| 150 |
# Try to open the spreadsheet by name
|
| 151 |
spreadsheet = client.open(custom_sheet_name)
|
| 152 |
is_new = False
|
| 153 |
+
print("Spreadsheet opened successfully:", custom_sheet_name)
|
| 154 |
except SpreadsheetNotFound:
|
| 155 |
# If it doesn't exist, create it
|
| 156 |
spreadsheet = client.create(custom_sheet_name)
|
|
|
|
| 158 |
spreadsheet.share('shanghuagao@gmail.com', perm_type='user', role='writer')
|
| 159 |
spreadsheet.share('rzhu@college.harvard.edu', perm_type='user', role='writer')
|
| 160 |
is_new = True
|
| 161 |
+
print("Spreadsheet created successfully:", custom_sheet_name)
|
| 162 |
print("Spreadsheet ID:", spreadsheet.id)
|
| 163 |
# Access the first worksheet
|
| 164 |
sheet = spreadsheet.sheet1
|