fix import

This commit is contained in:
j 2023-09-23 17:30:45 +02:00
parent 99fa247fd5
commit 19b4f8a8a4

View file

@ -6,7 +6,7 @@ from django.db.models.functions import ExtractWeek, ExtractYear
from ..item import models from ..item import models
from ..item.views import get_weeks from ..item.views import get_weeks, format_week
def week(year, month, day): def week(year, month, day):
@ -26,7 +26,7 @@ def week(year, month, day):
context['weeks'] = get_weeks(archive) context['weeks'] = get_weeks(archive)
monday = context['this_week'] = date.strftime('%Y-%m-%d') monday = context['this_week'] = date.strftime('%Y-%m-%d')
context['this_year'] = date.strftime('%Y') context['this_year'] = date.strftime('%Y')
context['week_title'] = 'Phantas.ma weekly update %s' % views.format_week(monday) context['week_title'] = 'Phantas.ma weekly update %s' % format_week(monday)
extra = models.Week.objects.filter(monday=context['this_week']).first() extra = models.Week.objects.filter(monday=context['this_week']).first()
if extra: if extra:
context['week_title'] += ': ' + extra.title context['week_title'] += ': ' + extra.title