get_default_username
Try to determine the current system user's username to use as a default.
def get_default_username(
check_db: boolean = True,
database: string = DEFAULT_DB_ALIAS
) - > string
Try to determine the current system user's username to use as a default.
Parameters
| Name | Type | Description |
|---|---|---|
| check_db | boolean = True | If True, requires that the username does not match an existing auth.User (otherwise returns an empty string). |
| database | string = DEFAULT_DB_ALIAS | The database where the unique check will be performed. |
Returns
| Type | Description |
|---|---|
string | The username, or an empty string if no username can be determined or the suggested username is already taken. |