From 8d58429b6942bdbb4ec4419e2364b80751b954cd Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Tue, 12 Jun 2018 17:39:12 +0530 Subject: [PATCH] [help-portal] don't show issues to guest --- erpnext/templates/pages/help.html | 6 ++++-- erpnext/templates/pages/help.py | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/templates/pages/help.html b/erpnext/templates/pages/help.html index a49268ac0a..2adfa3f7fe 100644 --- a/erpnext/templates/pages/help.html +++ b/erpnext/templates/pages/help.html @@ -11,7 +11,7 @@ value='{{ frappe.form_dict.q or ''}}' {% if not frappe.form_dict.q%}placeholder="{{ _("What do you need help with?") }}"{% endif %}> + class='btn btn-sm btn-default btn-search' value="{{ _("Search") }}"> @@ -47,6 +47,7 @@
+{% if issues | len > 0 -%}

{{ _("Your tickets") }}

{% for doc in issues %} @@ -55,8 +56,9 @@

{{ _("See all open tickets") }}

- + {{ _("Open a new ticket") }} +{%- endif %} {% endblock %} diff --git a/erpnext/templates/pages/help.py b/erpnext/templates/pages/help.py index c484d25d81..4ce2b31d30 100644 --- a/erpnext/templates/pages/help.py +++ b/erpnext/templates/pages/help.py @@ -19,7 +19,10 @@ def get_context(context): context.topics = topics_data[:3] # Issues - context.issues = frappe.get_list("Issue", fields=["name", "status", "subject", "modified"])[:3] + if frappe.session.user != "Guest": + context.issues = frappe.get_list("Issue", fields=["name", "status", "subject", "modified"])[:3] + else: + context.issues = [] def get_forum_posts(s): response = requests.get(s.forum_url + '/' + s.get_latest_query)