diff --git a/press/press/doctype/press_settings/press_settings.json b/press/press/doctype/press_settings/press_settings.json index 1925cb5d0a..a1ac5819c5 100644 --- a/press/press/doctype/press_settings/press_settings.json +++ b/press/press/doctype/press_settings/press_settings.json @@ -41,6 +41,7 @@ "erpnext_api_secret", "column_break_38", "frappeio_authentication_section", + "disable_frappe_auth", "frappe_url", "frappeio_api_key", "column_break_39", @@ -1181,11 +1182,17 @@ "fieldname": "disable_agent_job_deduplication", "fieldtype": "Check", "label": "Disable Agent Job Deduplication" + }, + { + "default": "0", + "fieldname": "disable_frappe_auth", + "fieldtype": "Check", + "label": "Disable Frappe Auth" } ], "issingle": 1, "links": [], - "modified": "2024-03-22 12:30:21.968896", + "modified": "2024-05-07 13:23:08.189526", "modified_by": "Administrator", "module": "Press", "name": "Press Settings", diff --git a/press/press/doctype/press_settings/press_settings.py b/press/press/doctype/press_settings/press_settings.py index eee4e4be3d..b8367fdf31 100644 --- a/press/press/doctype/press_settings/press_settings.py +++ b/press/press/doctype/press_settings/press_settings.py @@ -52,6 +52,7 @@ class PressSettings(Document): default_outgoing_pass: DF.Data | None disable_agent_job_deduplication: DF.Check disable_auto_retry: DF.Check + disable_frappe_auth: DF.Check docker_registry_namespace: DF.Data | None docker_registry_password: DF.Data | None docker_registry_url: DF.Data | None diff --git a/press/utils/billing.py b/press/utils/billing.py index 313a7cae91..7079c6b896 100644 --- a/press/utils/billing.py +++ b/press/utils/billing.py @@ -89,7 +89,9 @@ def get_frappe_io_connection(): "frappeio_api_secret", raise_exception=False ) - if not (frappe_api_key and frappe_api_secret and press_settings.frappe_url): + if not press_settings.disable_frappe_auth and not ( + frappe_api_key and frappe_api_secret and press_settings.frappe_url + ): frappe.throw("Frappe.io URL not set up in Press Settings", exc=FrappeioServerNotSet) frappe.local.press_frappeio_conn = FrappeClient(