Dear all,
I make a custom apps and it’s quite strange behavior of Python like below code. When the condition is meet in def validate and go to return & exit the function, it still run do_other_things(). I insert some code write log to see what is happened and my assumption not wrong. So how can I exit the validate immediately?
class RetailDepositRegistration(Document):
def query(self, sql):
db = Database('nifi',db_url='http://clickhouse:8123',readonly=True)
return db.select(sql)
def validate(self):
if self.idxacno:
if self.skip_verifying:
if (self.skip_verifying == 1 or "HR Manager" in frappe.get_roles(frappe.session.user)) :
return
do_other_things()