Use config.getboolean to get metrics enabled value (#770)

Given the following configuration:

[metrics]
enabled=False

Using config.get results in a METRICS_ENABLED value that always
evaluates to True. This PR switches to config.getboolean so that metrics
can be disabled without deleting the configuration values.
This commit is contained in:
Tim Freund
2018-02-18 11:40:13 -05:00
committed by Raphael Michel
parent a68686cb06
commit aecb536a34

View File

@@ -121,7 +121,7 @@ EMAIL_SUBJECT_PREFIX = '[pretix] '
ADMINS = [('Admin', n) for n in config.get('mail', 'admins', fallback='').split(",") if n]
METRICS_ENABLED = config.get('metrics', 'enabled', fallback=False)
METRICS_ENABLED = config.getboolean('metrics', 'enabled', fallback=False)
METRICS_USER = config.get('metrics', 'user', fallback="metrics")
METRICS_PASSPHRASE = config.get('metrics', 'passphrase', fallback="")