Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion archinstall/lib/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def _process_creds_data(self, creds_data: str) -> dict[str, Any] | None:
lambda p=prompt: get_password( # type: ignore[misc]
header=p,
allow_skip=False,
skip_confirmation=True,
no_confirmation=True,
)
)

Expand Down
11 changes: 7 additions & 4 deletions archinstall/lib/menu/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def get_password(
header: str | None = None,
allow_skip: bool = False,
preset: str | None = None,
skip_confirmation: bool = False,
no_confirmation: bool = False,
) -> Password | None:
while True:
result = await Input(
Expand All @@ -38,7 +38,7 @@ async def get_password(
password = Password(plaintext=result.get_value())
break

if skip_confirmation:
if no_confirmation:
return password

confirmation_header = f'{tr("Password")}: {password.hidden()}\n\n'
Expand All @@ -49,13 +49,16 @@ def _validate(value: str) -> str | None:
return tr('The password did not match, please try again')
return None

_ = await Input(
result = await Input(
header=confirmation_header,
allow_skip=False,
allow_skip=allow_skip,
password=True,
validator_callback=_validate,
).show()

if result.type_ == ResultType.Skip:
return None

return password


Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/user/user_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def handle_action(self, action: str, entry: User | None, data: list[User])
elif action == self._actions[1] and entry: # change password
header = f'{tr("User")}: {entry.username}\n'
header += tr('Enter new password')
new_password = await get_password(header=header)
new_password = await get_password(header=header, allow_skip=True)

if new_password:
user = next(filter(lambda x: x == entry, data))
Expand Down
Loading