Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: django conf should not be modified #341

Closed
wants to merge 2 commits into from
Closed

Conversation

techblack
Copy link

This place is passed by reference, which will cause the configuration to change, and other applications will read the wrong configuration

before this pr:
from django.conf import settings getattr(settings, "CHANNEL_LAYERS", {})
result

{'default': {'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': {'hosts': [{'sentinels': [('a.b.c.d', 6379)], 'master_name': 'redis-master', 'db': 0, 'password': 'password', 'sentinel_kwargs': {'password': 'password'}}]}}}

after channel connection result

{'default': {'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': {'hosts': [{'db': 0, 'password': 'password'}]}}}

@krisatverbidio
Copy link

Also affected by this bug. Would love to see this get merged in soon.

@carltongibson
Copy link
Member

I'm planning releases for the new year period. This is on the agenda for that.

Copy link
Contributor

@sevdog sevdog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work like pubsub layer, if a deepcopy is realy needed it should also be addressed also in that layer.

channels_redis/core.py Outdated Show resolved Hide resolved
Co-authored-by: Devid <setti.davide89@gmail.com>
@carltongibson
Copy link
Member

Resolved in #352. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants