emvecchi commited on
Commit
6e461b0
·
verified ·
1 Parent(s): 8d48a7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -516,6 +516,7 @@ def navigate(index_change):
516
 
517
  def show_field(f: Field, index: int, data_collected):
518
  if f.type not in INPUT_FIELD_DEFAULT_VALUES.keys():
 
519
  match f.type:
520
  case 'input_col':
521
  value = (
@@ -595,6 +596,10 @@ def show_field(f: Field, index: int, data_collected):
595
  elif f.following_mandatory_values and st.session_state[key] in f.following_mandatory_values:
596
  st.session_state.following_mandatory = True
597
 
 
 
 
 
598
  value = st.session_state[key] if key in st.session_state else \
599
  (data_collected[f.name] if data_collected else INPUT_FIELD_DEFAULT_VALUES[f.type])
600
 
 
516
 
517
  def show_field(f: Field, index: int, data_collected):
518
  if f.type not in INPUT_FIELD_DEFAULT_VALUES.keys():
519
+ st.session_state.following_mandatory = False
520
  match f.type:
521
  case 'input_col':
522
  value = (
 
596
  elif f.following_mandatory_values and st.session_state[key] in f.following_mandatory_values:
597
  st.session_state.following_mandatory = True
598
 
599
+ if f.mandatory or st.session_state.following_mandatory:
600
+ f.title += " :red[* required!]" if (validation_error and not SHOW_VALIDATION_ERROR_MESSAGE) else' :red[*]'
601
+ f.help = None
602
+
603
  value = st.session_state[key] if key in st.session_state else \
604
  (data_collected[f.name] if data_collected else INPUT_FIELD_DEFAULT_VALUES[f.type])
605