Skip to content

Commit

Permalink
fix: provision to disable frappe.io auth dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh6790 committed May 7, 2024
1 parent 4bb45ff commit 8504cfe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion press/press/doctype/press_settings/press_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"erpnext_api_secret",
"column_break_38",
"frappeio_authentication_section",
"disable_frappe_auth",
"frappe_url",
"frappeio_api_key",
"column_break_39",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions press/press/doctype/press_settings/press_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion press/utils/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8504cfe

Please sign in to comment.