From 0aef4103c44bd5e2e2577d73be778c37de382278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Wed, 20 Apr 2022 21:04:56 +0200 Subject: [PATCH] Fix a race condition while creating the DB --- ram/ram/admin.py | 10 ++++++++++ ram/ram/urls.py | 5 ----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 ram/ram/admin.py diff --git a/ram/ram/admin.py b/ram/ram/admin.py new file mode 100644 index 0000000..2edd0ff --- /dev/null +++ b/ram/ram/admin.py @@ -0,0 +1,10 @@ +from django.contrib import admin +from django.db.utils import OperationalError +from portal.utils import get_site_conf + +try: + site_name = get_site_conf().site_name +except OperationalError: + site_name = "Train Assets Manager" + +admin.site.site_header = site_name diff --git a/ram/ram/urls.py b/ram/ram/urls.py index 3f27eab..3d1edd9 100644 --- a/ram/ram/urls.py +++ b/ram/ram/urls.py @@ -19,11 +19,6 @@ from django.conf.urls.static import static from django.contrib import admin from django.urls import include, path -from portal.utils import get_site_conf - -site_conf = get_site_conf() -admin.site.site_header = site_conf.site_name - urlpatterns = [ path("", lambda r: redirect("/portal/")), path("portal/", include("portal.urls")),