numbas / editor

An editor for the Numbas e-learning system.
http://numbas.mathcentre.ac.uk
Apache License 2.0
59 stars 62 forks source link

add_member fails after new install with ALLOW_REGISTRATION=FALSE #497

Open davidhadas opened 4 years ago

davidhadas commented 4 years ago

After a new Ubuntu server install: While ALLOW_REGISTRATION = False When trying to add a member to a project...

add_member fails indicating debug message:

Request Method: POST

http://editor4.vmath.club/project/2/settings/add_member 2.2.10 NoReverseMatch Reverse for 'registration_register' not found. 'registration_register' is not a valid view function or pattern name. /opt/python/numbas-editor/lib/python3.6/site-packages/django/urls/resolvers.py in _reverse_with_prefix, line 673 /opt/python/numbas-editor/bin/python 3.6.9 ['/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/opt/python/numbas-editor/lib/python3.6/site-packages', '/srv/www/numbas_editor', '/srv/numbas/compiler/bin']

davidhadas commented 4 years ago

Looking at the code, I am not sure what the design in. It seems that the mechanism for adding users is based on self registration which is disabled by the ALLOW_REGISTRATION=FALSE.

What are the design expectations for adding a member to a project when the ALLOW_REGISTRATION=FALSE?

Shouldn't ALLOW_REGISTRATION=FALSE still allowed invitations?

christianp commented 4 years ago

Sorry this isn't clear. With registration turned off, we have either used LDAP authentication, or manually created accounts through the admin interface (accessed through /admin).

I've added some validation to the "add a member" form to disable adding by email address when ALLOW_REGISTRATION = False.

I'm leaving this open because it would be nice to be able to invite specific people to register, as you're trying to do.