added TINYWIKI_HOME settings for settings the app-specific homepages of the wiki

This commit is contained in:
2025-12-30 05:32:47 +01:00
parent e4fd21f998
commit 14c1d9d978
2 changed files with 5 additions and 4 deletions

View File

@@ -11,15 +11,15 @@ import string
from ..models import Page
from ..enums import WikiPageStatus
from django.utils.translation import ngettext, gettext as _
from ..import settings
# Create your views here.
class HomeView(View):
template_name = "tinywiki/home/home.html"
def get(self,request):
def get(self, request):
try:
page = Page.objects.get(slug='tw-home')
page = Page.objects.get(slug=settings.TINYWIKI_HOME)
if (not Page.status == WikiPageStatus.PUBLISHED
and not request.user.is_staff
and not request.user.has_perm('page.view-all')):
@@ -105,7 +105,6 @@ class TocView(View):
else:
pages_1 = toc_entries[split:]
if (key.startswith('0') or key == '#'):
toc_section = key
else: