AIdeaText commited on
Commit
9323bdb
1 Parent(s): 18e8360

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -63,11 +63,21 @@ def register_page():
63
  new_username = st.text_input("Nuevo Usuario")
64
  new_password = st.text_input("Nueva Contraseña", type='password')
65
  role = st.selectbox("Rol", ["Estudiante", "Profesor"])
 
 
 
 
 
 
 
 
 
 
66
  if st.button("Registrarse"):
67
- if register_user(new_username, new_password, role):
68
  st.success("Registro exitoso. Por favor, inicia sesión.")
69
  else:
70
- st.error("El usuario ya existe")
71
 
72
  def main_app():
73
  # Load spaCy models
 
63
  new_username = st.text_input("Nuevo Usuario")
64
  new_password = st.text_input("Nueva Contraseña", type='password')
65
  role = st.selectbox("Rol", ["Estudiante", "Profesor"])
66
+
67
+ # Aquí puedes añadir campos adicionales según el rol si lo deseas
68
+ additional_info = {}
69
+ if role == "Estudiante":
70
+ # Por ejemplo: additional_info['carrera'] = st.text_input("Carrera")
71
+ pass
72
+ elif role == "Profesor":
73
+ # Por ejemplo: additional_info['departamento'] = st.text_input("Departamento")
74
+ pass
75
+
76
  if st.button("Registrarse"):
77
+ if register_user(new_username, new_password, role, additional_info):
78
  st.success("Registro exitoso. Por favor, inicia sesión.")
79
  else:
80
+ st.error("El usuario ya existe o ocurrió un error durante el registro")
81
 
82
  def main_app():
83
  # Load spaCy models