File tree 4 files changed +26
-18
lines changed 4 files changed +26
-18
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 6.21.2 - Mar 3, 2025
4
+
5
+ * Catch Django Settings already configures exception
6
+
3
7
## 6.21.1 - Mar 1, 2025
4
8
5
9
* Update people repo cli usage
Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ def no_recent_people_repo_commit() -> bool:
28
28
last_commit_time = datetime .datetime .fromisoformat (
29
29
last_commit_time .rstrip ("Z" )
30
30
).replace (tzinfo = datetime .timezone .utc )
31
- two_hours_ago = datetime .datetime .now (
31
+ six_hours_ago = datetime .datetime .now (
32
32
datetime .timezone .utc
33
33
) - datetime .timedelta (
34
- minutes = 2 * 60 + 5
35
- ) # 2 hours and 5-minute buffer.
36
- no_recent_commit_exists = two_hours_ago > last_commit_time
34
+ minutes = 6 * 60 + 5
35
+ ) # 6 hours and 5-minute buffer.
36
+ no_recent_commit_exists = six_hours_ago > last_commit_time
37
37
return no_recent_commit_exists
38
38
39
39
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 } " )
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " openstates"
3
- version = " 6.21.1 "
3
+ version = " 6.21.2 "
4
4
description = " core infrastructure for the openstates project"
5
5
authors = [
" James Turk <[email protected] >" ]
6
6
license = " MIT"
You can’t perform that action at this time.
0 commit comments