[master/rhel7-branch/f23-branch] Make sure username entered in TUI if create a user chosen. (#1249660)

Samantha N. Bueno sbueno+anaconda at redhat.com
Fri Aug 14 19:40:50 UTC 2015


Add an extra check in the TUI user spoke to make sure that a username has
actually been entered if someone chooses to create a username.

Resolves: rhbz#1249660
---
 pyanaconda/ui/tui/spokes/user.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
index 029b939..0f0a3ef 100644
--- a/pyanaconda/ui/tui/spokes/user.py
+++ b/pyanaconda/ui/tui/spokes/user.py
@@ -143,7 +143,7 @@ class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
             self.args.groups.remove("wheel")
 
         # Add or remove the user from userlist as needed
-        if self.args._create and (self.args not in self.data.user.userList):
+        if self.args._create and (self.args not in self.data.user.userList and self.args.name):
             self.data.user.userList.append(self.args)
         elif (not self.args._create) and (self.args in self.data.user.userList):
             self.data.user.userList.remove(self.args)
-- 
1.9.3



More information about the anaconda-patches mailing list