mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix: dont validate currency exchange in setup
Redues ~4-5 seconds of time and chances of setup failure.
This commit is contained in:
committed by
Ankush Menat
parent
03c631d723
commit
086d31b59f
@@ -11,6 +11,8 @@ from frappe.utils import nowdate
|
|||||||
class CurrencyExchangeSettings(Document):
|
class CurrencyExchangeSettings(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.set_parameters_and_result()
|
self.set_parameters_and_result()
|
||||||
|
if frappe.flags.in_test or frappe.flags.in_install or frappe.flags.in_setup_wizard:
|
||||||
|
return
|
||||||
response, value = self.validate_parameters()
|
response, value = self.validate_parameters()
|
||||||
self.validate_result(response, value)
|
self.validate_result(response, value)
|
||||||
|
|
||||||
@@ -35,9 +37,6 @@ class CurrencyExchangeSettings(Document):
|
|||||||
self.append("req_params", {"key": "symbols", "value": "{to_currency}"})
|
self.append("req_params", {"key": "symbols", "value": "{to_currency}"})
|
||||||
|
|
||||||
def validate_parameters(self):
|
def validate_parameters(self):
|
||||||
if frappe.flags.in_test:
|
|
||||||
return None, None
|
|
||||||
|
|
||||||
params = {}
|
params = {}
|
||||||
for row in self.req_params:
|
for row in self.req_params:
|
||||||
params[row.key] = row.value.format(
|
params[row.key] = row.value.format(
|
||||||
@@ -59,9 +58,6 @@ class CurrencyExchangeSettings(Document):
|
|||||||
return response, value
|
return response, value
|
||||||
|
|
||||||
def validate_result(self, response, value):
|
def validate_result(self, response, value):
|
||||||
if frappe.flags.in_test:
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for key in self.result_key:
|
for key in self.result_key:
|
||||||
value = value[
|
value = value[
|
||||||
|
|||||||
Reference in New Issue
Block a user