#24532: AttributeError with custom routers that define allow_syncdb but not
allow_migrate
----------------------------------------------+---------------------------
Reporter: nealtodd | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.8rc1
Severity: Normal | Keywords: allow_migrate
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+---------------------------
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/24532>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.a2793f3e0c2e515fd8e3f168a065707c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.