Skip to content

Commit

Permalink
Fix ControlList
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Feb 11, 2019
1 parent 30eac5e commit fe065d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pyforms_terminal/basewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ def __parse_terminal_parameters(self):
var.value = value

elif isinstance(var, ControlList):
var.value = eval(value)

if value is not None:
var.value = eval(value)
else:
var.value = None
elif isinstance(var, (ControlText, ControlCombo)):
var.value = value

Expand Down
2 changes: 1 addition & 1 deletion pyforms_terminal/controls/control_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ControlList(ControlBase):
It allows to implement a list view
"""
def __init__(self, *args, **kwargs):
if 'default' not in kwargs: kwargs['default'] = []
if 'default' not in kwargs: kwargs['default'] = None
super(ControlList, self).__init__(*args, **kwargs)

def clear(self, headers=False):
Expand Down

0 comments on commit fe065d1

Please sign in to comment.