Skip to content

Commit 3e4e375

Browse files
committed
Add deprecation warnings for some old settings
1 parent f229e14 commit 3e4e375

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

instant/apps.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ def ready(self):
1818
global HANDLERS, CHANNELS, CHANNELS_NAMES
1919
from django.conf import settings
2020
from .utils import get_channels_for_roles
21+
from .conf import ENABLE_STAFF_CHANNEL, ENABLE_USERS_CHANNEL, \
22+
ENABLE_SUPERUSER_CHANNEL
23+
col = '\033[91m'
24+
endcol = '\033[0m'
25+
if ENABLE_STAFF_CHANNEL is True:
26+
print(col + "Warning from Django Instant" + endcol + ": the setting ENABLE_STAFF_CHANNEL "
27+
"will be deprecated in version 0.8. "
28+
"Please use declarative channels instead")
29+
if ENABLE_USERS_CHANNEL is True:
30+
print(col + "Warning from Django Instant" + endcol + ": the setting ENABLE_USERS_CHANNEL "
31+
"will be deprecated in version 0.8. "
32+
"Please use declarative channels instead")
33+
if ENABLE_SUPERUSER_CHANNEL is True:
34+
print(col + "Warning from Django Instant" + endcol + ": the setting ENABLE_SUPERUSER_CHANNEL "
35+
"will be deprecated in version 0.8. "
36+
"Please use declarative channels instead")
37+
2138
CHANNELS, CHANNELS_NAMES = get_channels_for_roles()
2239
try:
2340
if settings.INSTANT_DEBUG is True:

0 commit comments

Comments
 (0)