From cc083c5380566ea13882e81a92849436167febd3 Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Thu, 19 May 2022 16:11:11 -0400
Subject: [PATCH] Update name of AUTO_SET_LAST_DATE settings

---
 program/models.py    | 8 ++++----
 steering/settings.py | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/program/models.py b/program/models.py
index 96cda026..fcfdcad3 100644
--- a/program/models.py
+++ b/program/models.py
@@ -35,8 +35,8 @@ from django.utils import timezone
 from django.utils.translation import gettext_lazy as _
 from program.utils import parse_date, parse_datetime, parse_time
 from steering.settings import (
-    AUTO_SET_UNTIL_DATE_TO_DAYS_IN_FUTURE,
-    AUTO_SET_UNTIL_DATE_TO_END_OF_YEAR,
+    AUTO_SET_LAST_DATE_TO_DAYS_IN_FUTURE,
+    AUTO_SET_LAST_DATE_TO_END_OF_YEAR,
     THUMBNAIL_SIZES,
 )
 
@@ -357,12 +357,12 @@ class Schedule(models.Model):
             last_date = parse_date(str(sdl["last_date"]))
         else:
             # If last_date was not set, set it to the end of the year or add x days
-            if AUTO_SET_UNTIL_DATE_TO_END_OF_YEAR:
+            if AUTO_SET_LAST_DATE_TO_END_OF_YEAR:
                 year = timezone.now().year
                 last_date = parse_date(f"{year}-12-31")
             else:
                 last_date = first_date + timedelta(
-                    days=+AUTO_SET_UNTIL_DATE_TO_DAYS_IN_FUTURE
+                    days=+AUTO_SET_LAST_DATE_TO_DAYS_IN_FUTURE
                 )
 
         schedule = Schedule(
diff --git a/steering/settings.py b/steering/settings.py
index 2c91e907..7e47f677 100644
--- a/steering/settings.py
+++ b/steering/settings.py
@@ -157,12 +157,12 @@ DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
 THUMBNAIL_SIZES = ["640x480", "200x200", "150x150"]
 
 # When generating schedules/timeslots:
-# If until date wasn't set manually, add x days to the start date
-AUTO_SET_UNTIL_DATE_TO_DAYS_IN_FUTURE = 365
+# If last_date wasn't set manually, add timeslots until these number of days after the start_date
+AUTO_SET_LAST_DATE_TO_DAYS_IN_FUTURE = 365
 
-# If until date wasn't set manually, auto-set it to December 31 of the current year
+# If last_date wasn't set manually, add timeslots until the end of the current year
 # Overrides the above setting if True
-AUTO_SET_UNTIL_DATE_TO_END_OF_YEAR = True
+AUTO_SET_LAST_DATE_TO_END_OF_YEAR = True
 
 # URL to CBA - Cultural Broadcasting Archive
 CBA_URL = "https://cba.fro.at"
-- 
GitLab