Nelly-43 commited on
Commit
cc2278b
Β·
verified Β·
1 Parent(s): d342e33

Update app_web.py

Browse files
Files changed (1) hide show
  1. app_web.py +6 -9
app_web.py CHANGED
@@ -29,18 +29,15 @@ def cg_admin():
29
  except Exception as e:
30
  print("User is not logged in or the token is invalid:", e)
31
  orgs = []
32
-
33
- if "CGIAR" in orgs:
34
- return True, orgs
35
-
36
- return False, orgs
37
 
38
  # 1. Force a clean state wipe on first load of the browser session
39
- if "app_initialized" not in st.session_state:
40
  st.session_state.clear() # Wipes out any residual states
41
- st.session_state["app_initialized"] = True
42
 
43
- st.write(cg_admin())
44
  # ── Session initialisation ───────────────────────────────────────────────────
45
  def init_session():
46
  """Initialise st.session_state with messages list, cfg, and last_retrieval."""
@@ -69,7 +66,7 @@ def render_sidebar():
69
  cfg = st.session_state.cfg
70
 
71
  with st.sidebar:
72
- if cg_admin():
73
  st.header("Settings")
74
 
75
  # --- Provider dropdown ---
 
29
  except Exception as e:
30
  print("User is not logged in or the token is invalid:", e)
31
  orgs = []
32
+
33
+ return orgs
 
 
 
34
 
35
  # 1. Force a clean state wipe on first load of the browser session
36
+ if "orgs" in st.session_state:
37
  st.session_state.clear() # Wipes out any residual states
38
+ st.session_state["orgs"] = cg_admin()
39
 
40
+ st.write(st.session_state.orgs)
41
  # ── Session initialisation ───────────────────────────────────────────────────
42
  def init_session():
43
  """Initialise st.session_state with messages list, cfg, and last_retrieval."""
 
66
  cfg = st.session_state.cfg
67
 
68
  with st.sidebar:
69
+ if "CGIAR" in st.session_state.orgs:
70
  st.header("Settings")
71
 
72
  # --- Provider dropdown ---