Skip to content

Design: Allow students to see course that they are not enrolled in#67

Open
automaticcodeevolutionmanagement[bot] wants to merge 2 commits intomainfrom
acem-design/issue-66
Open

Design: Allow students to see course that they are not enrolled in#67
automaticcodeevolutionmanagement[bot] wants to merge 2 commits intomainfrom
acem-design/issue-66

Conversation

@automaticcodeevolutionmanagement
Copy link
Copy Markdown

Automated design proposal for #66.

Leave inline review comments to request changes.

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
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These user_roles should not be strings - but enums.

If an enum for the the roles already exists, please use them.

Otherwise, create it.

@automaticcodeevolutionmanagement
Copy link
Copy Markdown
Author

Design updated based on your feedback at 2026-04-07 07:03 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant