Skip to content
Snippets Groups Projects
Commit cc083c53 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Update name of AUTO_SET_LAST_DATE settings

parent 410897c2
No related branches found
No related tags found
No related merge requests found
Pipeline #1952 passed
......@@ -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(
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment