Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/menu/selection_menu.py
diff options
context:
space:
mode:
authorWerner Llácer <wllacer@gmail.com>2022-02-28 23:11:25 +0100
committerGitHub <noreply@github.com>2022-02-28 23:11:25 +0100
commit86d991f4422d920ca714f459be3be4352d1c40a1 (patch)
tree256ec13a6e92c8e1fbf0aeee718ca3e0ef8533b0 /archinstall/lib/menu/selection_menu.py
parent76a6c378936afd9e68f9a39246480d7f8d2b75be (diff)
User Management via lists (#1008)
* Fix user/superuser config * Fix flake8 * Remove timezone check since we have a default value now * Remove unused * add new widget ListManager * flake8 complains * Null_action appears now in the main list (to simplify additions to the list) Formatted data are now at the from to the actions submenu * Manage users thru a ListManagers * Define a default action in the menu, potentially independent of a null_action Both default and null actions don't have to be part of the element's action list Some cleanup Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton.feeds@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se>
Diffstat (limited to 'archinstall/lib/menu/selection_menu.py')
-rw-r--r--archinstall/lib/menu/selection_menu.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/archinstall/lib/menu/selection_menu.py b/archinstall/lib/menu/selection_menu.py
index 99015fad..8ac7dc99 100644
--- a/archinstall/lib/menu/selection_menu.py
+++ b/archinstall/lib/menu/selection_menu.py
@@ -497,6 +497,7 @@ class GlobalMenu(GeneralMenu):
Selector(
_('Specify superuser account'),
lambda preset: self._create_superuser_account(),
+ exec_func=lambda n,v:self._users_resynch(),
dependencies_not=['!root-password'],
display_func=lambda x: self._display_superusers())
self._menu_options['!users'] = \
@@ -504,6 +505,7 @@ class GlobalMenu(GeneralMenu):
_('Specify user account'),
lambda x: self._create_user_account(),
default={},
+ exec_func=lambda n,v:self._users_resynch(),
display_func=lambda x: list(x.keys()) if x else '[]')
self._menu_options['profile'] = \
Selector(
@@ -668,11 +670,11 @@ class GlobalMenu(GeneralMenu):
return profile
def _create_superuser_account(self):
- superusers = ask_for_superuser_account(str(_('Enter a username to create an additional superuser (leave blank to skip): ')))
+ superusers = ask_for_superuser_account(str(_('Manage superuser accounts: ')))
return superusers if superusers else None
def _create_user_account(self):
- users = ask_for_additional_users(str(_('Enter a username to create an additional user (leave blank to skip): ')))
+ users = ask_for_additional_users(str(_('Manage ordinary user accounts: ')))
return users
def _display_superusers(self):
@@ -682,3 +684,8 @@ class GlobalMenu(GeneralMenu):
return list(superusers.keys()) if superusers else '[]'
else:
return list(superusers.keys()) if superusers else ''
+
+ def _users_resynch(self):
+ self.synch('!superusers')
+ self.synch('!users')
+ return False \ No newline at end of file