fix(hub): Prevent registered actions

This commit is contained in:
Faris Ansari 2018-11-05 19:18:48 +05:30
parent 0d08da50c6
commit d6b664f7ee
3 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,6 @@ import requests
from frappe import _
from frappe.frappeclient import FrappeClient
from frappe.desk.form.load import get_attachments
from frappe.utils.file_manager import get_file_path
from six import string_types
current_user = frappe.session.user

View File

@ -113,6 +113,10 @@ export default {
content: this.review_content.get_value()
});
if (!hub.is_seller_registered()) {
frappe.throw(__('You need to login as a Marketplace User before you can add any reviews.'));
}
hub.call('add_item_review', {
hub_item_name: this.hub_item_name,
review: JSON.stringify(review)

View File

@ -265,6 +265,9 @@ export default {
},
report_item() {
if (!hub.is_seller_registered()) {
frappe.throw(__('Please login as a Marketplace User to report this item.'));
}
this.report_item_dialog.show();
},