Skip to content

Commit 8d6c56c

Browse files
authored
Allow skip on password confirmation (#4273)
1 parent e06dd62 commit 8d6c56c

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

archinstall/lib/args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def _process_creds_data(self, creds_data: str) -> dict[str, Any] | None:
501501
lambda p=prompt: get_password( # type: ignore[misc]
502502
header=p,
503503
allow_skip=False,
504-
skip_confirmation=True,
504+
no_confirmation=True,
505505
)
506506
)
507507

archinstall/lib/menu/util.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async def get_password(
1313
header: str | None = None,
1414
allow_skip: bool = False,
1515
preset: str | None = None,
16-
skip_confirmation: bool = False,
16+
no_confirmation: bool = False,
1717
) -> Password | None:
1818
def password_hint(value: str) -> InputInfo | None:
1919
if not value:
@@ -51,7 +51,7 @@ def password_hint(value: str) -> InputInfo | None:
5151
password = Password(plaintext=result.get_value())
5252
break
5353

54-
if skip_confirmation:
54+
if no_confirmation:
5555
return password
5656

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

65-
_ = await Input(
65+
result = await Input(
6666
header=confirmation_header,
67-
allow_skip=False,
67+
allow_skip=allow_skip,
6868
password=True,
6969
validator_callback=_validate,
7070
).show()
7171

72+
if result.type_ == ResultType.Skip:
73+
return None
74+
7275
return password
7376

7477

archinstall/lib/user/user_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def handle_action(self, action: str, entry: User | None, data: list[User])
4545
elif action == self._actions[1] and entry: # change password
4646
header = f'{tr("User")}: {entry.username}\n'
4747
header += tr('Enter new password')
48-
new_password = await get_password(header=header)
48+
new_password = await get_password(header=header, allow_skip=True)
4949

5050
if new_password:
5151
user = next(filter(lambda x: x == entry, data))

0 commit comments

Comments
 (0)