Skip to content

Commit

Permalink
Validate route: ´/course/<course_code>/moderate´
Browse files Browse the repository at this point in the history
Signed-off-by: William José Moreno Reyes <williamjmorenor@gmail.com>
  • Loading branch information
williamjmorenor committed Feb 6, 2024
1 parent 41a9257 commit d32c2de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions now_lms/vistas/courses.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def tomar_curso(course_code):
def moderar_curso(course_code):
"""Pagina principal del curso."""

if current_user.tipo == "moderator":
if current_user.tipo == "moderator" or current_user.tipo == "admin":
return render_template(
"learning/curso.html",
curso=Curso.query.filter_by(codigo=course_code).first(),
Expand All @@ -193,7 +193,7 @@ def moderar_curso(course_code):
tipo=TIPOS_RECURSOS,
)
else:
return redirect(url_for(".curso", codigo=course_code))
return redirect(url_for("course.curso", course_code=course_code))

Check warning on line 196 in now_lms/vistas/courses.py

View check run for this annotation

Codecov / codecov/patch

now_lms/vistas/courses.py#L196

Added line #L196 was not covered by tests


@course.route("/course/<course_code>/admin")
Expand Down
26 changes: 13 additions & 13 deletions tests/x_rutas_estaticas.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,19 +361,19 @@
como_instructor=[],
como_admin=[],
),
# Ruta(
# ruta="/course/now/moderate",
# no_session=302,
# admin=200,
# user=200,
# moderator=403,
# instructor=403,
# texto=[],
# como_user=[],
# como_moderador=[],
# como_instructor=[],
# como_admin=[],
# ),
Ruta(
ruta="/course/now/moderate",
no_session=302,
admin=200,
user=403,
moderator=200,
instructor=403,
texto=[],
como_user=[],
como_moderador=[],
como_instructor=[],
como_admin=[],
),
# Ruta(
# ruta="/course/now/admin",
# no_session=302,
Expand Down

0 comments on commit d32c2de

Please sign in to comment.