macropin / django-registration

Django-registration (redux) provides user registration functionality for Django websites.
http://django-registration-redux.readthedocs.org
Other
974 stars 350 forks source link

Admins from database instead of settings #341

Closed GasparPizarro closed 5 years ago

GasparPizarro commented 5 years ago

It would be nice that the registration admins list could be pulled from the user model database instead of from the settings py. The use case for this is that the admin of an app (who would be different from the developer of the app) could add users for the registration approval without touching source code or having to enter the host machine. My proposal is that the registration admins would be the users with is_superuser=True, and if there are no users matching the criterion, the regular (REGISTRATION_ADMINS or ADMINS).

Thoughts on this?

joshblum commented 5 years ago

@GasparPizarro why don't we add an optional setting REGISTRATION_ADMINS_GETTER (or similar) which holds a path to a function to get additional admins from the DB or wherever they are listed?

# settings.py
...
REGISTRATION_ADMINS_GETTER = "utils.get_reg_admins_from_db"
...

# utils.py
def get_reg_admins_from_db(): # args tbd
    return ['admin@admin.com']
joshblum commented 5 years ago

would you be interested in adding this functionality?

GasparPizarro commented 5 years ago

Yes I am, give me some time to develop it and make a pull request.

GasparPizarro commented 5 years ago

https://github.com/macropin/django-registration/pull/345

joshblum commented 5 years ago

thanks!