Update app.py
Browse files
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
|