use week title in email

This commit is contained in:
j 2025-03-02 22:25:40 +01:00
commit 5b2670859f
3 changed files with 16 additions and 3 deletions

View file

@ -43,6 +43,19 @@ def format_week(week):
extra = ''
return '%s - %s%s' % (a, b, extra)
def format_subject(monday):
a = datetime.strptime(monday, '%Y-%m-%d')
b = (a + timedelta(days=6))
fmt = '%b %d'
a = a.strftime(fmt)
b = b.strftime(fmt)
subject = '%s - %s | Phantas.ma' % (a, b)
extra = models.Week.objects.filter(monday=monday).first()
if extra and extra.title:
subject = '%s | %s' % (extra.title, subject)
return subject
def get_byline(week):
extra = models.Week.objects.filter(monday=week).first()
if extra: