Design: Allow students to see course that they are not enrolled in#67
Open
automaticcodeevolutionmanagement[bot] wants to merge 2 commits intomainfrom
Open
Design: Allow students to see course that they are not enrolled in#67automaticcodeevolutionmanagement[bot] wants to merge 2 commits intomainfrom
automaticcodeevolutionmanagement[bot] wants to merge 2 commits intomainfrom
Conversation
siscia
requested changes
Apr 7, 2026
ACEM_DESIGN_66.md
Outdated
Comment on lines
+48
to
+72
| user_roles = [] | ||
|
|
||
| if ( | ||
| teacher_profile | ||
| and CourseTeacher.objects.filter( | ||
| course=course, teacher=teacher_profile | ||
| ).exists() | ||
| ): | ||
| user_roles.append("teacher") | ||
|
|
||
| if student_profile and course.is_student_enrolled(student_profile): | ||
| user_roles.append("student") | ||
|
|
||
| if teacher_assistant_profile and course.is_teacher_assistant( | ||
| teacher_assistant_profile | ||
| ): | ||
| user_roles.append("teacher_assistant") | ||
|
|
||
| # NEW: Check if user is a logged-in student (even if not enrolled) | ||
| is_unenrolled_student = ( | ||
| student_profile is not None | ||
| and "student" not in user_roles | ||
| and "teacher" not in user_roles | ||
| and "teacher_assistant" not in user_roles | ||
| ) |
Contributor
There was a problem hiding this comment.
These user_roles should not be strings - but enums.
If an enum for the the roles already exists, please use them.
Otherwise, create it.
Author
|
Design updated based on your feedback at 2026-04-07 07:03 UTC. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated design proposal for #66.
Leave inline review comments to request changes.