Python Script Doesn't Run in V13.6.0, Conditions are not checked, works well in V12

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')
			)

This actually works, but it’s outputting a utf unicode error which I have created this thread:

ERROR: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x91 in position 187: invalid start byt - Developers / Bug - ERPNext Forum