#12999 closed (fixed)
update_all_contenttypes in contenttypes.management fails in django 1.2
Reported by: | lsbardel | Owned by: | nobody |
---|---|---|---|
Component: | Contrib apps | Version: | dev |
Severity: | Keywords: | contenttypes | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
Bug introduced with multiple database support. The function loop over installed applications and call update_contenttypes without passing a keyworded "db" argument.
update_contenttypes fails when no "db" is available. To fix the problem I replaced
db = kwargs["db"]
with
db = kwargs.get('db',None)
Attachments (2)
Change History (8)
by , 15 years ago
Attachment: | management.diff added |
---|
comment:1 by , 15 years ago
milestone: | 1.2 |
---|
comment:2 by , 15 years ago
milestone: | → 1.2 |
---|---|
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
by , 15 years ago
Attachment: | management_no_using.diff added |
---|
comment:3 by , 15 years ago
Removed "using" in update_contenttypes
. This way ContentType
objects will be saved in the default database or the one specified in the routing scheme.
comment:4 by , 15 years ago
Component: | Uncategorized → Contrib apps |
---|
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
To be clear, the issue is specifically with the update_all_contenttypes() call. This highlights that there are a couple of problems with the current implementation; there shouldn't be the need for calls to using in update_contenttypes().