fix: only allow class students to see progress

This commit is contained in:
Jannat Patel
2023-03-28 16:30:14 +05:30
parent a3a4d7fbd0
commit de399166f1

View File

@@ -143,7 +143,8 @@
</tr>
{% for student in class_students %}
{% set last_active = frappe.db.get_value("User", student.student, "last_active") %}
{% set allow_progress = is_moderator or student.student == frappe.session.user or frappe.db.get_single_value("LMS Settings", "allow_student_progress") %}
{% set allow_progress = is_moderator or student.student == frappe.session.user or (frappe.db.get_single_value("LMS Settings", "allow_student_progress") and
is_student) %}
<tr>
<td>
<a class="subheading button-links d-block" {% if allow_progress %} href="/classes/{{ class_info.name }}/students/{{ student.username }}" {% endif %}>