ml-visoft commited on
Commit
8111895
1 Parent(s): 06e8ac9

Debugging no button state change and bad session ID

Browse files
Files changed (1) hide show
  1. main.py +6 -5
main.py CHANGED
@@ -413,6 +413,7 @@ def render_clear_area(session_id, html_id):
413
 
414
  @rt("/")
415
  def get(session):
 
416
  if 'session_id' not in session:
417
  session['session_id'] = str(uuid.uuid4())
418
  session_id = session["session_id"]
@@ -469,17 +470,16 @@ def get(session):
469
 
470
 
471
  @rt("/submit_to_eval", methods="post")
472
- def post(ccodetoeval:str, session):
473
- if 'session_id' not in session: return P("submit_to_eval. Bad call. No session ID")
 
 
474
  session_id = session["session_id"]
475
  session_obj = Session_State_cls(
476
  session_id=session_id,
477
  state=EVAL_STATE_QUERY,
478
  submitted=datetime.utcnow(),
479
  )
480
-
481
- # assert False, "Need to refactor to insert new answer request and update the current answerID"
482
-
483
  # we insert and we get the new primary key
484
  session_obj = session_state_table.insert(session_obj)
485
  # will be executed in another thread with magic @threaded
@@ -493,6 +493,7 @@ def post(ccodetoeval:str, session):
493
  def get(session):
494
  if 'session_id' not in session: return P("clear_area. Bad call. No session ID")
495
  session_id = session["session_id"]
 
496
  save_to_storage(
497
  storage.NavigationEvent(event_type="/clear_area", event_session_id=session_id)
498
  )
 
413
 
414
  @rt("/")
415
  def get(session):
416
+ print(session)
417
  if 'session_id' not in session:
418
  session['session_id'] = str(uuid.uuid4())
419
  session_id = session["session_id"]
 
470
 
471
 
472
  @rt("/submit_to_eval", methods="post")
473
+ def post(session, ccodetoeval:str):
474
+ print(session)
475
+ if 'session_id' not in session:
476
+ return P("submit_to_eval. Bad call. No session ID")
477
  session_id = session["session_id"]
478
  session_obj = Session_State_cls(
479
  session_id=session_id,
480
  state=EVAL_STATE_QUERY,
481
  submitted=datetime.utcnow(),
482
  )
 
 
 
483
  # we insert and we get the new primary key
484
  session_obj = session_state_table.insert(session_obj)
485
  # will be executed in another thread with magic @threaded
 
493
  def get(session):
494
  if 'session_id' not in session: return P("clear_area. Bad call. No session ID")
495
  session_id = session["session_id"]
496
+
497
  save_to_storage(
498
  storage.NavigationEvent(event_type="/clear_area", event_session_id=session_id)
499
  )