diff --git a/erpnext/hub_node/api.py b/erpnext/hub_node/api.py index 6e11a86b86..85693c72af 100644 --- a/erpnext/hub_node/api.py +++ b/erpnext/hub_node/api.py @@ -3,12 +3,13 @@ import frappe, requests, json from frappe.utils import now from frappe.frappeclient import FrappeClient from frappe.desk.form.load import get_attachments +from six import string_types @frappe.whitelist() def call_hub_method(method, params=None): connection = get_hub_connection() - if type(params) == unicode: + if isinstance(params, string_types): params = json.loads(params) params.update({ diff --git a/erpnext/hub_node/doctype/hub_settings/hub_settings.py b/erpnext/hub_node/doctype/hub_settings/hub_settings.py index 96e3148c13..e445531d1e 100644 --- a/erpnext/hub_node/doctype/hub_settings/hub_settings.py +++ b/erpnext/hub_node/doctype/hub_settings/hub_settings.py @@ -21,6 +21,8 @@ class HubSettings(Document): frappe.throw(_("Please select a Price List to publish pricing")) def get_hub_url(self): + if not frappe.conf.hub_url: + frappe.throw('hub_url is not set in site_config') return frappe.conf.hub_url def register(self): diff --git a/erpnext/public/js/hub/components/detail_view.js b/erpnext/public/js/hub/components/detail_view.js index cd734058aa..f161e459e0 100644 --- a/erpnext/public/js/hub/components/detail_view.js +++ b/erpnext/public/js/hub/components/detail_view.js @@ -25,13 +25,16 @@ function get_detail_view_html(item, allow_edit) { stats = `${views_message}${dot_spacer}${rating_html} (${rating_count})`; } - let favourite_button = !item.favourited - ? `` - : ``; + let favourite_button = '' + if (hub.settings.registered) { + favourite_button = !item.favourited + ? `` + : ``; + } const contact_seller_button = item.hub_seller !== hub.settings.company_email ? `