From ef6ce2cad7b8c1e422bc0881abb3b9c9e30b8e47 Mon Sep 17 00:00:00 2001 From: sokumon Date: Tue, 3 Feb 2026 01:22:51 +0530 Subject: [PATCH 1/2] fix: show doctypes with guest view --- frappe/www/portal.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frappe/www/portal.py b/frappe/www/portal.py index cfe383dbae..400ca77123 100644 --- a/frappe/www/portal.py +++ b/frappe/www/portal.py @@ -8,13 +8,14 @@ from frappe.www.list import get_list_context, get_list_data def get_context(context, **dict_params): - if frappe.session.user == "Guest": - raise frappe.PermissionError frappe.local.form_dict.update(dict_params) context.show_sidebar = True doctype = frappe.local.form_dict.doctype if doctype: - context.meta = frappe.get_meta(doctype) + meta = frappe.get_meta(doctype) + if frappe.session.user == "Guest" and not meta.allow_guest_to_view: + return + context.meta = meta context.update(get_list_context(context, doctype) or {}) context.update(get(**frappe.local.form_dict)) context.home_page = "/portal" From bcbc529a4e8c6d7f2826bba3cdb2935100fc862d Mon Sep 17 00:00:00 2001 From: sokumon Date: Tue, 3 Feb 2026 02:01:24 +0530 Subject: [PATCH 2/2] fix: throw a permission error --- frappe/www/portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/www/portal.py b/frappe/www/portal.py index 400ca77123..2c858c6a82 100644 --- a/frappe/www/portal.py +++ b/frappe/www/portal.py @@ -14,7 +14,7 @@ def get_context(context, **dict_params): if doctype: meta = frappe.get_meta(doctype) if frappe.session.user == "Guest" and not meta.allow_guest_to_view: - return + frappe.throw(_("Login to view"), frappe.PermissionError) context.meta = meta context.update(get_list_context(context, doctype) or {}) context.update(get(**frappe.local.form_dict))