-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: filter allow email domain manage course team
Allow to add course team users that aren't allowed to enroll by the filter allow email domain. Use the normal procedure to skip the email domain, then the manage course team user case won't block adding the user to the course team. The filter only validates the email domain if the user is not already enrolled in the course. fccn/nau-technical#397
- Loading branch information
Showing
8 changed files
with
62 additions
and
22 deletions.
There are no files selected for viewing
21 changes: 16 additions & 5 deletions
21
nau_openedx_extensions/edxapp_wrapper/backends/student_l_v1.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
""" | ||
Real implementation on getting a student course enrollment allowed. | ||
""" | ||
from common.djangoapps.student.models import CourseEnrollmentAllowed # pylint: disable=import-error | ||
from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed # pylint: disable=import-error | ||
|
||
|
||
def get_student_course_enrollment_allowed(user, course_id, *args, **kwargs): | ||
""" | ||
Return configuration value for the key specified as name argument. | ||
Get the student CourseEnrollmentAllowed class instance from the edx-platform. | ||
Args: | ||
val_name (str): Name of the key for which to return configuration value. | ||
default: default value tp return if key is not found in the configuration | ||
user: The user id to find the CourseEnrollmentAllowed instance. | ||
course_id: The course id to find the CourseEnrollmentAllowed instance. | ||
Returns: | ||
Configuration value for the given key. | ||
A CourseEnrollmentAllowed instance or None | ||
""" | ||
return CourseEnrollmentAllowed.for_user(user).filter(course_id=course_id).first() | ||
|
||
def get_enrollment(user, course_key, *args, **kwargs): | ||
""" | ||
Gets the student CourseEnrollment class from the edx-platform. | ||
This class represents an user enrolled in a course. | ||
Args: | ||
user: The user id to find the Enrollment. | ||
course_key: The course key to find the Enrollment. | ||
""" | ||
return CourseEnrollment.get_enrollment(user, course_key) |
This file contains 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
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: [email protected]\n" | ||
"POT-Creation-Date: 2024-12-12 12:58-0500\n" | ||
"POT-Creation-Date: 2025-01-10 16:09+0000\n" | ||
"PO-Revision-Date: 2021-02-15 15:56+0000\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language: en\n" | ||
|
@@ -115,11 +115,11 @@ msgid "" | |
"{platform_name}." | ||
msgstr "" | ||
|
||
#: nau_openedx_extensions/filters/pipeline.py:63 | ||
#: nau_openedx_extensions/filters/pipeline.py:64 | ||
msgid "If you think this is an error, contact the course support." | ||
msgstr "" | ||
|
||
#: nau_openedx_extensions/filters/pipeline.py:64 | ||
#: nau_openedx_extensions/filters/pipeline.py:65 | ||
#, python-format | ||
msgid "" | ||
"You can't enroll on this course because your email domain is not allowed." | ||
|
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: [email protected]\n" | ||
"POT-Creation-Date: 2024-12-12 12:58-0500\n" | ||
"POT-Creation-Date: 2025-01-10 16:09+0000\n" | ||
"PO-Revision-Date: 2021-02-15 15:56+0000\n" | ||
"Last-Translator: Ivo Branco <[email protected]>\n" | ||
"Language: pt_PT\n" | ||
|
@@ -120,11 +120,11 @@ msgstr "" | |
"Verifique no seu e-mail {email} o link de ativação da conta " | ||
"{platform_name}." | ||
|
||
#: nau_openedx_extensions/filters/pipeline.py:63 | ||
#: nau_openedx_extensions/filters/pipeline.py:64 | ||
msgid "If you think this is an error, contact the course support." | ||
msgstr "Se achar que se trata de um erro, contacte o suporte." | ||
|
||
#: nau_openedx_extensions/filters/pipeline.py:64 | ||
#: nau_openedx_extensions/filters/pipeline.py:65 | ||
#, python-format | ||
msgid "" | ||
"You can't enroll on this course because your email domain is not allowed." | ||
|