From 8197c86a2f5bddee162da53bffd4b5c682c65e43 Mon Sep 17 00:00:00 2001 From: UlrichB22 <97119703+UlrichB22@users.noreply.github.com> Date: Mon, 26 May 2025 21:52:59 +0200 Subject: [PATCH 1/2] move 'user.may.destroy' call from template to views.py --- src/moin/themes/focus/templates/itemviews.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/moin/themes/focus/templates/itemviews.html b/src/moin/themes/focus/templates/itemviews.html index 91bea6776..518f444d9 100644 --- a/src/moin/themes/focus/templates/itemviews.html +++ b/src/moin/themes/focus/templates/itemviews.html @@ -100,7 +100,7 @@ {%- endif %} - {%- if endpoint == 'frontend.destroy_item' and user.may.destroy(fqname) %} + {%- if endpoint == 'frontend.destroy_item' and may.destroy %}
From becda8e24d9f9a1e8f818d21af5fbf9fdd727e45 Mon Sep 17 00:00:00 2001 From: UlrichB22 <97119703+UlrichB22@users.noreply.github.com> Date: Mon, 26 May 2025 22:20:47 +0200 Subject: [PATCH 2/2] skip before_wiki and teardown_wiki for content in _themes --- src/moin/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/moin/app.py b/src/moin/app.py index 91f41803a..e65660b19 100644 --- a/src/moin/app.py +++ b/src/moin/app.py @@ -14,7 +14,6 @@ from __future__ import annotations import os -import re import sys from os import path, PathLike @@ -408,7 +407,7 @@ def is_static_content(request_path): Check if content is static and does not need usual wiki handling """ - if request_path.startswith(("/static/", "/+serve/", "/+template/")) or re.match(r"/_themes/\w+/css/", request_path): + if request_path.startswith(("/static/", "/+serve/", "/+template/", "/_themes/")): return True else: return False