Spaces:
Runtime error
Runtime error
Update db.py
Browse files
db.py
CHANGED
|
@@ -98,7 +98,13 @@ def fetch_room_names(supabase: Client):
|
|
| 98 |
raise
|
| 99 |
if not res or not res.data:
|
| 100 |
return []
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
def fetch_room_names_by_owner(supabase: Client, owner_teacher_id: str):
|
| 104 |
safe_owner = str(owner_teacher_id or "").strip()
|
|
|
|
| 98 |
raise
|
| 99 |
if not res or not res.data:
|
| 100 |
return []
|
| 101 |
+
visible_rooms = []
|
| 102 |
+
for item in res.data:
|
| 103 |
+
room = str(item.get("room_name", "")).strip()
|
| 104 |
+
owner = str(item.get("created_by", "")).strip()
|
| 105 |
+
if room and owner:
|
| 106 |
+
visible_rooms.append(room)
|
| 107 |
+
return visible_rooms
|
| 108 |
|
| 109 |
def fetch_room_names_by_owner(supabase: Client, owner_teacher_id: str):
|
| 110 |
safe_owner = str(owner_teacher_id or "").strip()
|