Exemplo n.º 1
0
def get_allowlisted_users(course_key):
    """
    Return the users who are on the allowlist for this course run
    """
    if not _is_using_certificate_allowlist(course_key):
        return User.objects.none()

    return User.objects.filter(certificatewhitelist__course_id=course_key, certificatewhitelist__whitelist=True)
Exemplo n.º 2
0
 def test_is_using_allowlist_false(self):
     """
     Test the allowlist flag without the override
     """
     self.assertFalse(_is_using_certificate_allowlist(self.course_run_key))
Exemplo n.º 3
0
 def test_is_using_allowlist_true(self):
     """
     Test the allowlist flag
     """
     self.assertTrue(_is_using_certificate_allowlist(self.course_run_key))