forked from rc/aircox
- !88 pytest on existing tests - !89 reorganise settings (! see notes for deployment) Co-authored-by: bkfox <thomas bkfox net> Reviewed-on: rc/aircox#92
This commit is contained in:
@ -15,7 +15,8 @@ from django.utils import timezone as tz
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from aircox import settings, utils
|
||||
from aircox import utils
|
||||
from aircox.conf import settings
|
||||
|
||||
from .page import Page, PageQuerySet
|
||||
from .station import Station
|
||||
@ -77,9 +78,7 @@ class Program(Page):
|
||||
@property
|
||||
def path(self):
|
||||
"""Return program's directory path."""
|
||||
return os.path.join(
|
||||
settings.AIRCOX_PROGRAMS_DIR, self.slug.replace("-", "_")
|
||||
)
|
||||
return os.path.join(settings.PROGRAMS_DIR, self.slug.replace("-", "_"))
|
||||
|
||||
@property
|
||||
def abspath(self):
|
||||
@ -88,11 +87,11 @@ class Program(Page):
|
||||
|
||||
@property
|
||||
def archives_path(self):
|
||||
return os.path.join(self.path, settings.AIRCOX_SOUND_ARCHIVES_SUBDIR)
|
||||
return os.path.join(self.path, settings.SOUND_ARCHIVES_SUBDIR)
|
||||
|
||||
@property
|
||||
def excerpts_path(self):
|
||||
return os.path.join(self.path, settings.AIRCOX_SOUND_ARCHIVES_SUBDIR)
|
||||
return os.path.join(self.path, settings.SOUND_ARCHIVES_SUBDIR)
|
||||
|
||||
def __init__(self, *kargs, **kwargs):
|
||||
super().__init__(*kargs, **kwargs)
|
||||
@ -107,8 +106,8 @@ class Program(Page):
|
||||
We assume the path has been given in a previous time by this
|
||||
model (Program.path getter).
|
||||
"""
|
||||
if path.startswith(settings.AIRCOX_PROGRAMS_DIR_ABS):
|
||||
path = path.replace(settings.AIRCOX_PROGRAMS_DIR_ABS, "")
|
||||
if path.startswith(settings.PROGRAMS_DIR_ABS):
|
||||
path = path.replace(settings.PROGRAMS_DIR_ABS, "")
|
||||
while path[0] == "/":
|
||||
path = path[1:]
|
||||
path = path[: path.index("/")]
|
||||
|
Reference in New Issue
Block a user