Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#24000 closed Bug (fixed)

create_default_site 'db' kwarg should be 'using'

Reported by: tkhyn Owned by: Tim Graham
Component: contrib.sites Version: 1.7
Severity: Release blocker Keywords: sites multidb
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by tkhyn)

Almost a non-bug as it only prevents the creation of the 'example.com' entry in the django_site table when this table does not lie in the default database (in case of a multi-db setup).

As the post_migrate signal uses the keyword using, it is indeed not picked up by create_default_site which uses db.

Trivial patch attached.

Attachments (1)

create_default_site_patch.patch (2.5 KB) - added by tkhyn 6 years ago.

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by tkhyn

comment:1 Changed 6 years ago by tkhyn

Description: modified (diff)

comment:2 Changed 6 years ago by Tim Graham

Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

I think we need a backwards compatibility shim to check db as well since that's used by the post_syncdb signal. Could you also add a regression test?

comment:3 Changed 6 years ago by Tim Graham

Severity: NormalRelease blocker

comment:4 Changed 6 years ago by Tim Graham

Owner: changed from nobody to Tim Graham
Status: newassigned
Version: master1.7

comment:5 Changed 6 years ago by Tim Graham

Needs tests: unset
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

Actually, it doesn't seem that a backwards compatibility shim is required.

comment:6 Changed 6 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 89e2c60f4396241c667b7a1de37765b7c96d702f:

Fixed #24000 -- Corrected contrib.sites default site creation in a multiple database setup.

comment:7 Changed 6 years ago by Tim Graham <timograham@…>

In a79012f6d88a8cd67bd35c54b91d826f2b7a4cb2:

[1.7.x] Fixed #24000 -- Corrected contrib.sites default site creation in a multiple database setup.

Backport of 89e2c60f4396241c667b7a1de37765b7c96d702f from master

Note: See TracTickets for help on using tickets.
Back to Top