Skip to content

Pipeline

hypha.apply.users.pipeline

make_otf_staff

make_otf_staff(backend, user, response, *args, **kwargs)
Source code in hypha/apply/users/pipeline.py
def make_otf_staff(backend, user, response, *args, **kwargs):
    _, email_domain = user.email.split("@")
    if email_domain in settings.STAFF_EMAIL_DOMAINS:
        staff_group = Group.objects.get(name=STAFF_GROUP_NAME)
        user.groups.add(staff_group)
        # Required in order to allow access to django admin, no other functional use
        user.is_staff = True