Skip to content

fix: django conf should not be modified#341

Closed
techblack wants to merge 2 commits intodjango:mainfrom
techblack:main
Closed

fix: django conf should not be modified#341
techblack wants to merge 2 commits intodjango:mainfrom
techblack:main

Conversation

@techblack
Copy link
Copy Markdown

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
Copy Markdown

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

@carltongibson
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
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.

Comment thread channels_redis/core.py Outdated
Co-authored-by: Devid <setti.davide89@gmail.com>
@carltongibson
Copy link
Copy Markdown
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.

4 participants