Spaces:
Build error
Build error
Changed how descriptions are uploaded
Browse files
main.py
CHANGED
|
@@ -205,14 +205,22 @@ def submit_preferences(schedule_name: str, curr_juggler_name: str, curr_email: s
|
|
| 205 |
for elem in og_slots:
|
| 206 |
if elem in curr_availability:
|
| 207 |
final_checkboxes.append(elem)
|
| 208 |
-
|
| 209 |
curr_availability = f"{DELIMITER}".join(final_checkboxes)
|
| 210 |
availabilities.extend([curr_availability])
|
| 211 |
|
|
|
|
| 212 |
curr_descriptions = [elem['name'] for elem in curr_descriptions]
|
| 213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
descriptions = form[DESCRIP_COL]
|
| 215 |
-
descriptions.extend([
|
| 216 |
|
| 217 |
# Update Supabase
|
| 218 |
my_obj = json.dumps({
|
|
|
|
| 205 |
for elem in og_slots:
|
| 206 |
if elem in curr_availability:
|
| 207 |
final_checkboxes.append(elem)
|
| 208 |
+
|
| 209 |
curr_availability = f"{DELIMITER}".join(final_checkboxes)
|
| 210 |
availabilities.extend([curr_availability])
|
| 211 |
|
| 212 |
+
# Format descriptions
|
| 213 |
curr_descriptions = [elem['name'] for elem in curr_descriptions]
|
| 214 |
+
new_str = ''
|
| 215 |
+
if len(curr_descriptions) > 1:
|
| 216 |
+
for i, elem in enumerate(curr_descriptions):
|
| 217 |
+
new_str += f"{i + 1}. \"{elem.strip()}\"\n"
|
| 218 |
+
new_str = new_str.strip()
|
| 219 |
+
else:
|
| 220 |
+
new_str += f"\"{curr_descriptions[0]}\""
|
| 221 |
+
|
| 222 |
descriptions = form[DESCRIP_COL]
|
| 223 |
+
descriptions.extend([new_str])
|
| 224 |
|
| 225 |
# Update Supabase
|
| 226 |
my_obj = json.dumps({
|