Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions archinstall/lib/interactions/manage_users_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def _add_user(self) -> User | None:
case _:
raise ValueError('Unhandled result type')

if not username:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like _check_for_correct_username is supposed to ensure that the username starts with a lowercase letter or underscore (but it's not doing so).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can trigger the message The username you entered is invalid to appear below the input field by starting a username without a lowercase letter or underscore. I am not sure why it is not working for you.

Seems like skip would be the intended outcome when pressing enter at an empty input field.

Copy link
Copy Markdown
Contributor Author

@codefiles codefiles May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean, why is an empty string not triggering the validator? The validator will not be used when text is an empty string.

if text and self._validator:
if (err := self._validator(text)) is not None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, that was the confusing part. I assumed the validator function would run on all inputs :).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty string is essentially no input, so there is nothing to validate. Makes sense to me anyway.

return None

header = f'{tr("Username")}: {username}\n'

password = get_password(tr('Password'), header=header, allow_skip=True)
Expand Down