From 07c80f885a106bbab9cf52064f6b358744c361e8 Mon Sep 17 00:00:00 2001 From: Wes Appler Date: Tue, 15 Sep 2026 08:44:54 -0400 Subject: [PATCH 1/3] Handle `can_publish` seperately from the wagtail `CopyForm` --- hypha/apply/funds/admin_views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hypha/apply/funds/admin_views.py b/hypha/apply/funds/admin_views.py index 85f692c5f4..7fa0894ee3 100644 --- a/hypha/apply/funds/admin_views.py +++ b/hypha/apply/funds/admin_views.py @@ -22,10 +22,12 @@ def custom_admin_round_copy_view(request, page): # Check if the user has permission to publish subpages on the parent can_publish = parent_page.permissions_for_user(request.user).can_publish_subpage() + print("CAN PUBLISH") + print(can_publish) + if not can_publish: + raise PermissionDenied(_("You do not have permission to publish this round.")) - form = CopyForm( - request.POST or None, user=request.user, page=page, can_publish=can_publish - ) + form = CopyForm(request.POST or None, user=request.user, page=page) next_url = get_valid_next_url_from_request(request) From d27826de610aa4b56a6d219250e994f78f51e337 Mon Sep 17 00:00:00 2001 From: Wes Appler Date: Tue, 15 Sep 2026 09:23:15 -0400 Subject: [PATCH 2/3] Remove debug statements --- hypha/apply/funds/admin_views.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/hypha/apply/funds/admin_views.py b/hypha/apply/funds/admin_views.py index 7fa0894ee3..bd7ee28a36 100644 --- a/hypha/apply/funds/admin_views.py +++ b/hypha/apply/funds/admin_views.py @@ -22,8 +22,6 @@ def custom_admin_round_copy_view(request, page): # Check if the user has permission to publish subpages on the parent can_publish = parent_page.permissions_for_user(request.user).can_publish_subpage() - print("CAN PUBLISH") - print(can_publish) if not can_publish: raise PermissionDenied(_("You do not have permission to publish this round.")) From 7a9392e94c6f8545bf38cad76aeebce8cc8f66df Mon Sep 17 00:00:00 2001 From: Wes Appler Date: Fri, 18 Sep 2026 10:27:18 -0400 Subject: [PATCH 3/3] Removed old `can_publish` code --- hypha/apply/funds/admin_views.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hypha/apply/funds/admin_views.py b/hypha/apply/funds/admin_views.py index bd7ee28a36..f9f0c84657 100644 --- a/hypha/apply/funds/admin_views.py +++ b/hypha/apply/funds/admin_views.py @@ -20,11 +20,6 @@ def custom_admin_round_copy_view(request, page): # Parent page defaults to parent of source page parent_page = page.get_parent() - # Check if the user has permission to publish subpages on the parent - can_publish = parent_page.permissions_for_user(request.user).can_publish_subpage() - if not can_publish: - raise PermissionDenied(_("You do not have permission to publish this round.")) - form = CopyForm(request.POST or None, user=request.user, page=page) next_url = get_valid_next_url_from_request(request)