fix: base_url
This commit is contained in:
parent
689e39acf9
commit
9f6fc4618f
1 changed files with 7 additions and 5 deletions
|
|
@ -21,11 +21,13 @@ class ConnectedApp(Document):
|
|||
"""
|
||||
|
||||
def validate(self):
|
||||
try:
|
||||
base_url = frappe.request.host_url
|
||||
except RuntimeError:
|
||||
# for tests
|
||||
base_url = frappe.get_site_config().host_name or 'http://localhost:8000'
|
||||
if not frappe.flags.in_test:
|
||||
try:
|
||||
base_url = frappe.request.host_url
|
||||
except RuntimeError:
|
||||
base_url = frappe.utils.get_url()
|
||||
else:
|
||||
base_url = 'http://localhost:8000'
|
||||
|
||||
callback_path = '/api/method/frappe.integrations.doctype.connected_app.connected_app.callback/' + self.name
|
||||
self.redirect_uri = urljoin(base_url, callback_path)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue