fix: Stop showing course certificate buttons to beta testers (#28416)
Beta testers can’t earn course certificates, so they should not see a “Request Certificate” button or other info describing how they can earn a cert. MICROBA-992
This commit is contained in:
@@ -112,3 +112,11 @@ def update_forum_role(course_id, user, rolename, action):
|
||||
role.users.remove(user)
|
||||
else:
|
||||
raise ValueError(f"unrecognized action '{action}'")
|
||||
|
||||
|
||||
def is_beta_tester(user, course_id):
|
||||
"""
|
||||
Returns True if the user is a beta tester in this course, and False if not
|
||||
"""
|
||||
beta_testers_queryset = list_with_level(course_id, 'beta')
|
||||
return beta_testers_queryset.filter(username=user.username).exists()
|
||||
|
||||
Reference in New Issue
Block a user