mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
give a default other than None
1. If the setting isn't in the database, then the specified default is returned. 2. If the setting IS in the database, then the 'value' field, from the database, is returned; Unless, the value is null in the database, then the defined default is returned. * Take case 1. If the default=None then an AttributeError is raised * Thus, by setting default='', in case 1. We don't get an AttributeError because '' will be returned. * Also note that we don't allow_null=True because then the database entry could be None. Accessing the setting would raise an AttributeError in this case. Further, since we set default='' it doesn't matter if null is in the database. TL;DR set default=<something_other_than_None>
This commit is contained in:
parent
9db49d9819
commit
54bcdccdab
@ -322,5 +322,5 @@ register(
|
||||
help_text=_('Useful to uniquely identify Tower instances.'),
|
||||
category=_('Logging'),
|
||||
category_slug='logging',
|
||||
default=None,
|
||||
default='',
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user