Opened 10 years ago
Closed 10 years ago
#24532 closed Bug (fixed)
AttributeError with custom routers that define allow_syncdb but not allow_migrate
Description ¶
router.allow_syncdb is deprecated and will be removed in 1.9. However, although django.db.utils.ConnectionRouter.allow_migrate() issues a warning to that effect if allow_migrate is not defined, a subsequent line inspects the arguments for router.allow_migrate causing an AttributeError.
The attached patch inspects method
set in the try-except block which will be whichever of allow_syncdb or allow_migrate is defined.
If it was allow_syncdb that was defined then the code will then go on to issue the warning about the signature change to allow_migrate (allow_syncdb has the same signature as the old allow_migrate signature). Given that this warning was preceded by the warning to rename the allow_syncdb method that shouldn't cause confusion.
Change History (3)
by , 10 years ago
Attachment: | patch.diff added |
---|
comment:1 by , 10 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In b81ce2e: