fix
Browse files- backend_api.py +10 -0
backend_api.py
CHANGED
|
@@ -915,6 +915,11 @@ async def deploy(
|
|
| 915 |
# This ensures we catch spaces that were deployed in this session
|
| 916 |
if session_token and session_token in user_sessions:
|
| 917 |
session = user_sessions[session_token]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 918 |
deployed_spaces = session.get("deployed_spaces", [])
|
| 919 |
|
| 920 |
print(f"[Deploy] Checking session for existing spaces. Found {len(deployed_spaces)} deployed spaces.")
|
|
@@ -972,6 +977,11 @@ async def deploy(
|
|
| 972 |
if session_token and session_token in user_sessions:
|
| 973 |
if repo_id:
|
| 974 |
session = user_sessions[session_token]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 975 |
deployed_spaces = session.get("deployed_spaces", [])
|
| 976 |
|
| 977 |
print(f"[Deploy] 📝 Tracking space in session...")
|
|
|
|
| 915 |
# This ensures we catch spaces that were deployed in this session
|
| 916 |
if session_token and session_token in user_sessions:
|
| 917 |
session = user_sessions[session_token]
|
| 918 |
+
|
| 919 |
+
# Ensure deployed_spaces exists (for backward compatibility with old sessions)
|
| 920 |
+
if "deployed_spaces" not in session:
|
| 921 |
+
session["deployed_spaces"] = []
|
| 922 |
+
|
| 923 |
deployed_spaces = session.get("deployed_spaces", [])
|
| 924 |
|
| 925 |
print(f"[Deploy] Checking session for existing spaces. Found {len(deployed_spaces)} deployed spaces.")
|
|
|
|
| 977 |
if session_token and session_token in user_sessions:
|
| 978 |
if repo_id:
|
| 979 |
session = user_sessions[session_token]
|
| 980 |
+
|
| 981 |
+
# Ensure deployed_spaces exists
|
| 982 |
+
if "deployed_spaces" not in session:
|
| 983 |
+
session["deployed_spaces"] = []
|
| 984 |
+
|
| 985 |
deployed_spaces = session.get("deployed_spaces", [])
|
| 986 |
|
| 987 |
print(f"[Deploy] 📝 Tracking space in session...")
|