James McCool commited on
Commit
f344ebf
·
1 Parent(s): 3e52c68

Enhance session state checks for contest information in app.py

Browse files

- Added an additional condition to verify the presence of 'display_contest_info' in session state, improving data handling and preventing potential errors.
- This update ensures that the application maintains stability and provides a better user experience by managing contest data more effectively.

Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -261,6 +261,7 @@ with tab2:
261
  st.session_state['field_stack_frame'] = create_stack_exposures(working_df)
262
  st.session_state['display_contest_info'] = working_df.copy()
263
 
 
264
  with st.expander("Info and filters"):
265
  st.info("Note that any filtering here needs to be reset manually, i.e. if you parse down the specific users and want to reset the table, just backtrack your filtering by setting it back to 'All'")
266
  if st.button('Clear data', key='reset3'):
@@ -303,6 +304,7 @@ with tab2:
303
  st.session_state['display_contest_info'] = st.session_state['display_contest_info'][mask]
304
  if st.session_state['low_entries_var'] and st.session_state['high_entries_var']:
305
  st.session_state['display_contest_info'] = st.session_state['display_contest_info'][st.session_state['display_contest_info']['EntryCount'].between(st.session_state['low_entries_var'], st.session_state['high_entries_var'])]
 
306
  if 'display_contest_info' in st.session_state:
307
  # Initialize pagination in session state if not exists
308
  if 'current_page' not in st.session_state:
 
261
  st.session_state['field_stack_frame'] = create_stack_exposures(working_df)
262
  st.session_state['display_contest_info'] = working_df.copy()
263
 
264
+ if 'display_contest_info' in st.session_state:
265
  with st.expander("Info and filters"):
266
  st.info("Note that any filtering here needs to be reset manually, i.e. if you parse down the specific users and want to reset the table, just backtrack your filtering by setting it back to 'All'")
267
  if st.button('Clear data', key='reset3'):
 
304
  st.session_state['display_contest_info'] = st.session_state['display_contest_info'][mask]
305
  if st.session_state['low_entries_var'] and st.session_state['high_entries_var']:
306
  st.session_state['display_contest_info'] = st.session_state['display_contest_info'][st.session_state['display_contest_info']['EntryCount'].between(st.session_state['low_entries_var'], st.session_state['high_entries_var'])]
307
+
308
  if 'display_contest_info' in st.session_state:
309
  # Initialize pagination in session state if not exists
310
  if 'current_page' not in st.session_state: