better default value for boolean values
This commit is contained in:
@ -1110,6 +1110,12 @@ class FamilyAnnotator:
|
||||
variable.frozen = True
|
||||
if not variable.auto_save is True and 'force_default_on_freeze' not in vars(variable):
|
||||
variable.force_default_on_freeze = True
|
||||
if not has_value and variable.type == 'boolean':
|
||||
new_value = self.objectspace.value()
|
||||
new_value.name = True
|
||||
new_value.type = 'boolean'
|
||||
variable.value = [new_value]
|
||||
variable.mandatory = True
|
||||
|
||||
def change_variable_mode(self): # pylint: disable=C0111
|
||||
if not hasattr(self.objectspace.space, 'variables'):
|
||||
|
@ -20,7 +20,7 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
|
||||
'string': dict(opttype="StrOption"),
|
||||
'password': dict(opttype="PasswordOption"),
|
||||
'mail': dict(opttype="EmailOption"),
|
||||
'boolean': dict(opttype="BoolOption", initkwargs={'default': [True]}),
|
||||
'boolean': dict(opttype="BoolOption"),
|
||||
'symlink': dict(opttype="SymLinkOption"),
|
||||
'filename': dict(opttype="FilenameOption"),
|
||||
'date': dict(opttype="DateOption"),
|
||||
|
Reference in New Issue
Block a user