From 54bcdccdab8a0a85ec54bc205008508967b3c882 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Thu, 2 Mar 2017 13:26:27 -0500 Subject: [PATCH] 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= --- awx/main/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/conf.py b/awx/main/conf.py index bbdf159ae6..098b84f639 100644 --- a/awx/main/conf.py +++ b/awx/main/conf.py @@ -322,5 +322,5 @@ register( help_text=_('Useful to uniquely identify Tower instances.'), category=_('Logging'), category_slug='logging', - default=None, + default='', )