Skip to content

fix: show staff tag for global staff in discussion forum#187

Open
Alam-2U wants to merge 1 commit intorelease-ulmofrom
COSMO2-842
Open

fix: show staff tag for global staff in discussion forum#187
Alam-2U wants to merge 1 commit intorelease-ulmofrom
COSMO2-842

Conversation

@Alam-2U
Copy link

@Alam-2U Alam-2U commented Mar 16, 2026

Description

Global staff users were being displayed as learners in the discussion forum, and the staff tag was not shown.

Issue :

The course staff check was overriding the global staff check. As a result, if a user was not marked as course staff, they were displayed as a learner even if they had global staff privileges.

Ticket :

COSMO2-842

Copilot AI review requested due to automatic review settings March 16, 2026 11:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes global staff users being displayed as "learner" in the discussion forum by checking User.is_staff before the course-level role check.

Changes:

  • Adds a global staff check at the top of _get_user_label to return "Staff" for Django superusers/staff before falling through to course-level role checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Returns the role label (i.e. "Staff", "Moderator" or "Community TA") for the user
with the given id.
"""
if User.objects.get(id=user_id).is_staff:
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.

2 participants