Configure allowed email patterns

Dear community,

I would like to know if it’s possible to configure allowed email patterns for registration with Open edX tutor.

tried adding this in my config.yml:

“REGISTRATION_EMAIL_PATTERNS_ALLOWED” = [

"^.*@(.*\\.)?example\\.com$",
"(^\\w+\\.\\w+)@school\\.tld$"

]

But it hasn’t worked.

I would appreciate any help. Thank you.

It looks like that’s the example used in the documentation. Can you share something that’s more representative of what you’re actually trying to use in your deployment?

We did this using a plugin:

hooks.Filters.ENV_PATCHES.add_items([
    (
        "openedx-common-settings",
"""
REGISTRATION_EMAIL_PATTERNS_ALLOWED = [
    "^.*@(.*\\.)?DOMAIN\\.ca$",
    "(^\\w+\\.\\w+)@DOMAIN\\.ca$"
]
AUTH_PASSWORD_VALIDATORS = [
{
    'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
    'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    'OPTIONS': {
        'min_length': 9,
    }
},
{
    'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
    'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
"""
    )
])
2 Likes

Sorry to resurrect an old post, but I’m dying to know how to implement a plugin like this? I’ve been trying to wrap my head around plugin documentation but I’m a little out of my depth it seems. How do we create and activate a plugin file like this? I checked “tutor plugins printroot”
(/home/tutor/.local/share/tutor-plugins) but files I create there don’t show up in tutor plugins list

Can you provide an example of a plugin file?

In short there are two types of plugin files, .yaml and .py, and for .yaml to show up in the list I think it should have name set, and for the .py it will use the filename as the plugin name.

Also what is version of your tutor tutor --version?

Hi @ghassan
I have made an amateur mistake and was working in the wrong dir. Thanks, sorry for wasting your time