Skip to content

Commit 00be12e

Browse files
committed
Renamed internal methods in core channel layer.
Internal API was renamed in Channels 4.2.1
1 parent b359bf7 commit 00be12e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

channels_redis/core.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ async def send(self, channel, message):
169169
"""
170170
# Typecheck
171171
assert isinstance(message, dict), "message is not a dict"
172-
assert self.valid_channel_name(channel), "Channel name not valid"
172+
assert self.require_valid_channel_name(channel), "Channel name not valid"
173173
# Make sure the message does not contain reserved keys
174174
assert "__asgi_channel__" not in message
175175
# If it's a process-local channel, strip off local part and stick full name in message
@@ -256,7 +256,7 @@ async def receive(self, channel):
256256
"""
257257
# Make sure the channel name is valid then get the non-local part
258258
# and thus its index
259-
assert self.valid_channel_name(channel)
259+
assert self.require_valid_channel_name(channel)
260260
if "!" in channel:
261261
real_channel = self.non_local_name(channel)
262262
assert real_channel.endswith(
@@ -377,7 +377,7 @@ async def receive_single(self, channel):
377377
Receives a single message off of the channel and returns it.
378378
"""
379379
# Check channel name
380-
assert self.valid_channel_name(channel, receive=True), "Channel name invalid"
380+
assert self.require_valid_channel_name(channel, receive=True), "Channel name invalid"
381381
# Work out the connection to use
382382
if "!" in channel:
383383
assert channel.endswith("!")
@@ -482,8 +482,8 @@ async def group_add(self, group, channel):
482482
Adds the channel name to a group.
483483
"""
484484
# Check the inputs
485-
assert self.valid_group_name(group), "Group name not valid"
486-
assert self.valid_channel_name(channel), "Channel name not valid"
485+
assert self.require_valid_group_name(group), "Group name not valid"
486+
assert self.require_valid_channel_name(channel), "Channel name not valid"
487487
# Get a connection to the right shard
488488
group_key = self._group_key(group)
489489
connection = self.connection(self.consistent_hash(group))
@@ -498,8 +498,8 @@ async def group_discard(self, group, channel):
498498
Removes the channel from the named group if it is in the group;
499499
does nothing otherwise (does not error)
500500
"""
501-
assert self.valid_group_name(group), "Group name not valid"
502-
assert self.valid_channel_name(channel), "Channel name not valid"
501+
assert self.require_valid_group_name(group), "Group name not valid"
502+
assert self.require_valid_channel_name(channel), "Channel name not valid"
503503
key = self._group_key(group)
504504
connection = self.connection(self.consistent_hash(group))
505505
await connection.zrem(key, channel)
@@ -508,7 +508,7 @@ async def group_send(self, group, message):
508508
"""
509509
Sends a message to the entire group.
510510
"""
511-
assert self.valid_group_name(group), "Group name not valid"
511+
assert self.require_valid_group_name(group), "Group name not valid"
512512
# Retrieve list of all channel names
513513
key = self._group_key(group)
514514
connection = self.connection(self.consistent_hash(group))

0 commit comments

Comments
 (0)