ml-visoft commited on
Commit
94adbb0
1 Parent(s): 8111895

Debugging no button state change and bad session ID

Browse files
Files changed (1) hide show
  1. main.py +2 -1
main.py CHANGED
@@ -148,7 +148,7 @@ def html_create_feedback_updown_button(qe_id, ans_id, selected=0, disabled=False
148
  down_col = colors[0]
149
  if selected == 1: up_col = colors[1]
150
  if selected == -1: down_col = colors[1]
151
- toggle_url = f"toggle_up_down/{qe_id}/{ans_id}/"
152
  up = Button("+", hx_put=f"{toggle_url}?which=1", disabled=disabled, hx_swap="outerHTML",
153
  hx_target="#" + html_target_id, style=f"background-color:{up_col}")
154
  down = Button("-", hx_put=f"{toggle_url}?which=-1", disabled=disabled, hx_swap="outerHTML",
@@ -185,6 +185,7 @@ def put(session, qe_id:int, ans_id:int, which:int):
185
  """
186
  print(qe_id, ans_id, which)
187
  if which not in {-1, 1}:
 
188
  return None
189
 
190
  # if 'session_id' not in session:
 
148
  down_col = colors[0]
149
  if selected == 1: up_col = colors[1]
150
  if selected == -1: down_col = colors[1]
151
+ toggle_url = f"/toggle_up_down/{qe_id}/{ans_id}/"
152
  up = Button("+", hx_put=f"{toggle_url}?which=1", disabled=disabled, hx_swap="outerHTML",
153
  hx_target="#" + html_target_id, style=f"background-color:{up_col}")
154
  down = Button("-", hx_put=f"{toggle_url}?which=-1", disabled=disabled, hx_swap="outerHTML",
 
185
  """
186
  print(qe_id, ans_id, which)
187
  if which not in {-1, 1}:
188
+ print(f"The {which=} is bad")
189
  return None
190
 
191
  # if 'session_id' not in session: