Skip to content

Commit

Permalink
Don't crash if no groups are specified (#1316816)
Browse files Browse the repository at this point in the history
If the groups input field in the GUI is empty, set the groups list to an
empty list instead of a list containing an empty string.
  • Loading branch information
dashea committed Mar 31, 2016
1 parent 535b7f1 commit fe14b64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyanaconda/ui/gui/spokes/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def apply(self):
else:
self._user.gid = None

self._user.groups = [g.strip() for g in self._tGroups.get_text().split(",")]
# ''.split(',') returns [''] instead of [], which is not what we want
self._user.groups = [g.strip() for g in self._tGroups.get_text().split(",") if g]

def run(self):
self.window.show()
Expand Down

0 comments on commit fe14b64

Please sign in to comment.