I was trying to implement metabase integration following this app and when I completed it, it’s not working as expected. For example in the “Metabase Settings” doctype, when I set Dashboard Expiration to 0, it should output an error but it doesn’t in this case.
These python conditionals are not run.
-- coding: utf-8 --
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class MetabaseSettings(Document):
def validate(self):
# remove trailing slash
self.metabase_url = self.metabase_url.rstrip('/')
# check expiration time not less than 0
if self.metabase_exp_time < 0:
frappe.throw(
_('Dashboard Expiration cannot less than 0')
)