mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Add blank defaults to conditions and parameters
This commit is contained in:
parent
42b1a0d3de
commit
2e83b42ba9
2 changed files with 12 additions and 6 deletions
|
@ -1070,9 +1070,9 @@ def dbcheck():
|
||||||
|
|
||||||
# Upgrade notifiers table from earlier versions
|
# Upgrade notifiers table from earlier versions
|
||||||
try:
|
try:
|
||||||
c_db.execute('SELECT custom_condition FROM notifiers')
|
c_db.execute('SELECT custom_conditions FROM notifiers')
|
||||||
except sqlite3.OperationalError:
|
except sqlite3.OperationalError:
|
||||||
logger.debug(u"Altering database. Updating database table custom_condition.")
|
logger.debug(u"Altering database. Updating database table notifiers.")
|
||||||
c_db.execute(
|
c_db.execute(
|
||||||
'ALTER TABLE notifiers ADD COLUMN custom_conditions TEXT'
|
'ALTER TABLE notifiers ADD COLUMN custom_conditions TEXT'
|
||||||
)
|
)
|
||||||
|
|
|
@ -2950,10 +2950,16 @@ class WebInterface(object):
|
||||||
def get_notifier_config_modal(self, notifier_id=None, **kwargs):
|
def get_notifier_config_modal(self, notifier_id=None, **kwargs):
|
||||||
result = notifiers.get_notifier_config(notifier_id=notifier_id)
|
result = notifiers.get_notifier_config(notifier_id=notifier_id)
|
||||||
|
|
||||||
parameters = [
|
if not result['custom_conditions']:
|
||||||
{'name': param['name'], 'type': param['type'], 'value': param['value']}
|
result['custom_conditions'] = json.dumps([{'coefficient': '', 'operator': '', 'value': ''}])
|
||||||
for category in common.NOTIFICATION_PARAMETERS
|
|
||||||
for param in category['parameters']
|
if not result['custom_conditions_logic']:
|
||||||
|
result['custom_conditions_logic'] = ''
|
||||||
|
|
||||||
|
parameters = [{'name': '', 'type': '', 'value': ''}]
|
||||||
|
parameters += [
|
||||||
|
{'name': param['name'], 'type': param['type'], 'value': param['value']}
|
||||||
|
for category in common.NOTIFICATION_PARAMETERS for param in category['parameters']
|
||||||
]
|
]
|
||||||
|
|
||||||
return serve_template(templatename="notifier_config.html", notifier=result, parameters=json.dumps(parameters))
|
return serve_template(templatename="notifier_config.html", notifier=result, parameters=json.dumps(parameters))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue