Skip to content

feat: add filters to restrict enrollment FAN-41 - #5

Merged
MaferMazu merged 1 commit into
nau/lilac.masterfrom
dev/add-filters-to-restrict-enrollment
Sep 28, 2022
Merged

feat: add filters to restrict enrollment FAN-41#5
MaferMazu merged 1 commit into
nau/lilac.masterfrom
dev/add-filters-to-restrict-enrollment

Conversation

@MaferMazu

@MaferMazu MaferMazu commented Aug 30, 2022

Copy link
Copy Markdown
Contributor

Description

This PR adds the feature FAN-41: NAU Academies - restrict course enrollment by email domain.

Screenshot from 2022-09-26 13-30-46
User interface when a user can't enroll (en)
Screenshot from 2022-09-26 13-31-05
User interface when a user can't enroll (pt-pt)

Screenshot from 2022-08-29 16-53-49
Internal logs

Dependencies

How to test

In #6 I added tests.

In tutor:

  • Use a tutor environment with edx-platform with nau/lilac.master branch
  • Use nau-openedx-extension (this branch)
  • You need to add the following settings
FEATURES.update({
    "ENABLE_OTHER_COURSE_SETTINGS": True
    })
OPEN_EDX_FILTERS_CONFIG = {
        "org.openedx.learning.course.enrollment.started.v1": {
            "fail_silently": False,
            "pipeline": [
                "nau_openedx_extensions.filters.pipeline.FilterEnrollmentByDomain",
            ],
        },
    }
{
    "filter_enrollment_by_domain_list": [
        "domain1.com",
        "domain2.com",
        "example.com"
    ]
}
  • Create a user with a domain or subdomain in the filter_enrollment_by_domain_list, and the user will be able to enroll
  • Create a user with a domain, not in the list, and the user won't be able to enroll
  • You can change the lang preference, and the UI message error will be in the correct lang

@MaferMazu
MaferMazu marked this pull request as ready for review August 30, 2022 23:59
Comment thread nau_openedx_extensions/filters/models.py Outdated
Comment thread nau_openedx_extensions/filters/pipeline.py Outdated
@MaferMazu
MaferMazu force-pushed the dev/add-filters-to-restrict-enrollment branch from eb7c7e8 to 0e12aad Compare September 15, 2022 05:28
Comment thread nau_openedx_extensions/filters/pipeline.py Outdated
Comment thread nau_openedx_extensions/filters/pipeline.py Outdated
@MaferMazu

Copy link
Copy Markdown
Contributor Author

This PR is ready for review.

If you are okey I am going to squash the commits in this PR and merge when I have the approval

@felipemontoya @igobranco @MoisesGSalas

@felipemontoya felipemontoya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this covers my previous comments. Thanks @MaferMazu

The commits in detail:

feat: add model and admin for DomainsAllowedPerCourse

feat: add FilterEnrollmentByDomain

Revert "feat: add model and admin for DomainsAllowedPerCourse"

This reverts commit 54d8f99.

feat: add wrapper to obtain allowed_domains in other_course_settings

refactor: use "filter_enrollment_by_domain_list" instead domains_allowed

fix: issues with import and issues with obtain filter_enrollment_by_domain_list

feat: allow exception translation and allow match with subdomains
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.

3 participants