Authentication

Password Reset Request Form

class ycms.cms.forms.authentication.password_reset_request_form.PasswordResetRequestForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)

Bases: Form

Form for user password resets

Form fields:

property media

Return all media required to render the widgets on this form.

Registration Form

class ycms.cms.forms.authentication.registration_form.RegistrationForm(*args, **kwargs)

Bases: CustomModelForm

Form for user self-registration

Form fields:

__init__(*args, **kwargs)

Initialize user registration form

Parameters:
  • *args (list) – The supplied arguments

  • **kwargs (dict) – The supplied keyword arguments

clean_email()

Ensure the email does not exist yet, see Overriding the clean() method: If the email is already registered, add a ValidationError.

Returns:

The email

Return type:

str

clean_personnel_id()

Ensure the personnel_id does not exist yet, see Overriding the clean() method: If the personnel_id is already registered, add a ValidationError.

Returns:

The personnel_id

Return type:

str

property media

Return all media required to render the widgets on this form.

save(commit=True)

This method extends the default save()-method of the base ModelForm to create a new non-active user with role nurse.

Parameters:

commit (bool) – Whether or not the changes should be written to the database

Returns:

The saved user

Return type:

User