File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,20 @@ def init_django() -> None: # pragma: no cover
15
15
else :
16
16
DATABASES ["default" ]["OPTIONS" ]["application_name" ] = application_name
17
17
18
- conf .settings .configure (
19
- conf .global_settings ,
20
- SECRET_KEY = "not-important" ,
21
- DEBUG = False ,
22
- INSTALLED_APPS = (
23
- "django.contrib.contenttypes" ,
24
- "openstates.data" ,
25
- ),
26
- DATABASES = DATABASES ,
27
- TIME_ZONE = "UTC" ,
28
- MIDDLEWARE_CLASSES = (),
29
- )
30
- django .setup ()
18
+ try :
19
+ conf .settings .configure (
20
+ conf .global_settings ,
21
+ SECRET_KEY = "not-important" ,
22
+ DEBUG = False ,
23
+ INSTALLED_APPS = (
24
+ "django.contrib.contenttypes" ,
25
+ "openstates.data" ,
26
+ ),
27
+ DATABASES = DATABASES ,
28
+ TIME_ZONE = "UTC" ,
29
+ MIDDLEWARE_CLASSES = (),
30
+ )
31
+ django .setup ()
32
+ except RuntimeError as e :
33
+ if "Settings already configured." not in str (e ):
34
+ raise RuntimeError (f"Encountered error { e } " )
You can’t perform that action at this time.
0 commit comments