Skip to content

Commit c7a14f6

Browse files
authored
fix: Typo when reading DJANGOCMS_VERSIONING_ON_PUBLISH_REDIRECT (#522)
* fix: Typo when reading `DJANGOCMS_VERSIONING_ON_PUBLISH_REDIRECT` * fix linting * fix: Add deprecation warning * Add django-treebeard dependency to requirements
1 parent d0294cd commit c7a14f6

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

djangocms_versioning/conf.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,29 @@
3232
)
3333

3434
ON_PUBLISH_REDIRECT = getattr(
35-
settings, "DJANGOCMS_VERISONING_ON_PUBLISH_REDIRECT", "published"
35+
settings,
36+
"DJANGOCMS_VERSIONING_ON_PUBLISH_REDIRECT",
37+
# Released typo (VERISONING instead VERSIONING)
38+
getattr(settings, "DJANGOCMS_VERISONING_ON_PUBLISH_REDIRECT", "published")
3639
)
3740
#: Allowed values: "versions", "published", "preview"
3841

42+
if hasattr(settings, "DJANGOCMS_VERISONING_ON_PUBLISH_REDIRECT") and not hasattr(
43+
settings, "DJANGOCMS_VERSIONING_ON_PUBLISH_REDIRECT"
44+
):
45+
import warnings
46+
47+
warnings.warn(
48+
(
49+
"The incorrectly spelled 'DJANGOCMS_VERISONING_ON_PUBLISH_REDIRECT' setting "
50+
"is deprecated and will be removed in a future release. "
51+
"Please rename it to 'DJANGOCMS_VERSIONING_ON_PUBLISH_REDIRECT'."
52+
),
53+
DeprecationWarning,
54+
stacklevel=2,
55+
)
56+
57+
3958
VERBOSE_UI = getattr(
4059
settings, "DJANGOCMS_VERSIONING_VERBOSE_UI", True
4160
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
-r requirements_dev.txt
22
mysqlclient>=2.2.1
33
psycopg2
4+
django-treebeard<5

0 commit comments

Comments
 (0)