FocusFlow Assistant commited on
Commit
6dab24d
·
1 Parent(s): 479eeb5

Fix: Ensure current_state exists before saving plan

Browse files
Files changed (1) hide show
  1. backend/student_data.py +4 -0
backend/student_data.py CHANGED
@@ -188,6 +188,10 @@ class StudentProfileManager:
188
  "num_days": num_days,
189
  "topics": topics
190
  }
 
 
 
 
191
  profile["current_state"]["active_plan_id"] = plan_id
192
 
193
  self.save_profile(profile)
 
188
  "num_days": num_days,
189
  "topics": topics
190
  }
191
+
192
+ # Ensure current_state exists
193
+ if "current_state" not in profile:
194
+ profile["current_state"] = {}
195
  profile["current_state"]["active_plan_id"] = plan_id
196
 
197
  self.save_profile(profile)