Skip to content

Commit

Permalink
fix (GHA): import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Oct 19, 2023
1 parent 3de1123 commit 7cf4199
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions metropolis/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Dict, List

from django.utils import timezone
from timetable_formats import *
from .timetable_formats import *

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -504,24 +504,6 @@
EVENTS_NOTIFY_FEEDS = [] # list of PKs of organizations
NOTIF_DRY_RUN = True

try:
from metropolis.config import *
except ImportError as err:
pass
else:
import warnings

warnings.warn(DeprecationWarning("use local_settings.py instead of config.py"))

try:
with open(os.path.join(os.path.dirname(__file__), "local_settings.py")) as f:
exec(f.read(), globals())
except IOError:
pass

if SECRET_KEY == "Change me":
raise TypeError("override SECRET_KEY")


def is_aware(d: datetime) -> bool:
return d.tzinfo is not None and d.tzinfo.utcoffset(d) is not None
Expand Down Expand Up @@ -551,3 +533,22 @@ def compat_conv(banner: Dict) -> Dict:
BANNER2 += list(
map(compat_conv, filter(lambda b: b["start"] < now < b["end"], BANNER3))
)


try:
from metropolis.config import *
except ImportError as err:
pass
else:
import warnings

warnings.warn(DeprecationWarning("use local_settings.py instead of config.py"))

try:
with open(os.path.join(os.path.dirname(__file__), "local_settings.py")) as f:
exec(f.read(), globals())
except IOError:
pass

if SECRET_KEY == "Change me":
raise TypeError("override SECRET_KEY")

0 comments on commit 7cf4199

Please sign in to comment.