Skip to main content

UserCreationForm

This class provides a form for creating new users while ensuring username uniqueness through case-insensitive validation. It extends the base user creation functionality to prevent the registration of accounts with usernames that differ only by capitalization. The form automatically handles error reporting when a conflicting username is detected in the database.

Methods


clean_username()

@classmethod
def clean_username() - > string

Reject usernames that differ only in case.

Returns

TypeDescription
stringThe validated username string if no case-insensitive collision exists in the database.