1
0
mirror of https://github.com/django/django.git synced 2025-04-20 07:14:35 +00:00

[5.0.x] Fixed #34903, Refs #34825 -- Made workers initialization respect empty set of used connections.

Thanks to David Smith for the investigation & patch.

Regression in 2128a73713735fb794ca6565fd5d7792293f5cfa.
Follow up to a5905b164dbf52e59fa646af9c3d523c0804d86a.

Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
Backport of 68d0159b6dfce07f144045d56639c52066e8b90e from main
This commit is contained in:
David Sanders 2023-10-23 14:41:34 +11:00 committed by Mariusz Felisiak
parent 4dec7eded9
commit 08aa336af4

View File

@ -431,7 +431,7 @@ def _init_worker(
django.setup()
setup_test_environment(debug=debug_mode)
db_aliases = used_aliases or connections
db_aliases = used_aliases if used_aliases is not None else connections
for alias in db_aliases:
connection = connections[alias]
if start_method == "spawn":