Implement sign-up codes #1

Closed
opened 2025-11-18 07:57:27 -06:00 by digimint · 3 comments
Owner
  • An administrator should be able to restrict sign-ups to be by invite only, with invites creatable either by any user or by only administrators.
  • An administrator should be able to generate an invite code to allow a sophont to make an account.
  • If permitted by the system configuration, a user should be able to generate an invite code to allow another sophont to make an account.
  • A sophont with an invite code should be able to create an account using that invite code.
- [x] An administrator should be able to restrict sign-ups to be by invite only, with invites creatable either by any user or by only administrators. - [x] An administrator should be able to generate an invite code to allow a sophont to make an account. - [x] If permitted by the system configuration, a user should be able to generate an invite code to allow another sophont to make an account. - [x] A sophont with an invite code should be able to create an account using that invite code.
digimint added this to the Taskflower v0.1.0 project 2025-11-18 07:57:27 -06:00
digimint self-assigned this 2025-11-18 09:13:52 -06:00
Author
Owner

Sign-up restrictions are controlled by enum-type configuration parameter sign_up_mode. Sign-ups can be OPEN (no restrictions), USERS_CAN_INVITE (invites required but any user can generate one), or ADMINS_CAN_INVITE (invites required and only the system admin can generate one)

Sign-up restrictions are controlled by enum-type configuration parameter `sign_up_mode`. Sign-ups can be `OPEN` (no restrictions), `USERS_CAN_INVITE` (invites required but any user can generate one), or `ADMINS_CAN_INVITE` (invites required and only the system admin can generate one)
Author
Owner

Sign-up codes are stored as DB object SignUpCode. Logic for checking and deleting sign-up codes is stored in taskflower.form.user.CreateUserForm - if CreateUserForm.validate() returns True, then the validation was successful, and calling create_object() will automatically delete the sign-up code.

This logic also injects an extra parameter into the form object for template purposes - form.code_required is True if the user needs to provide a sign-up code. The HTML template should check this value and show or hide the field accordingly.

Sign-up codes are stored as DB object `SignUpCode`. Logic for checking and deleting sign-up codes is stored in `taskflower.form.user.CreateUserForm` - if `CreateUserForm.validate()` returns `True`, then the validation was successful, and calling `create_object()` will automatically delete the sign-up code. This logic also injects an extra parameter into the `form` object for template purposes - `form.code_required` is `True` if the user needs to provide a sign-up code. The HTML template should check this value and show or hide the field accordingly.
Author
Owner

templates/user/new_user.html now properly checks form.code_required and will insert a code entry field if needed.

`templates/user/new_user.html` now properly checks `form.code_required` and will insert a code entry field if needed.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: digimint/taskflower#1
No description provided.