mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Fix holding config variable in database through proxy objects
A config variable may not necessarily be None when not configured. Can be stored in the database with the help of proxy objects, which can return the None value when accessed. For example, to integrate with jazzband/django-constance.
This commit is contained in:
parent
e1d060398c
commit
add3baff74
1 changed files with 2 additions and 2 deletions
|
|
@ -21,8 +21,8 @@ def get_required_setting(setting, value_re, invalid_msg):
|
|||
value = getattr(settings, setting)
|
||||
except AttributeError:
|
||||
raise AnalyticalException("%s setting: not found" % setting)
|
||||
if value is None:
|
||||
raise AnalyticalException("%s setting is set to None" % setting)
|
||||
if not value:
|
||||
raise AnalyticalException("%s setting is not set" % setting)
|
||||
value = str(value)
|
||||
if not value_re.search(value):
|
||||
raise AnalyticalException("%s setting: %s: '%s'"
|
||||
|
|
|
|||
Loading…
Reference in a new issue