mirror of
https://github.com/django/django.git
synced 2025-04-26 18:24:36 +00:00
Silence deprecation warnings.
Also they should only be raised if allow_syncdb does exist, not just if allow_migrate does not. Refs comments on 250841017c6c456806cadd214b4e130aa998233d
This commit is contained in:
parent
d25622000a
commit
d238ab2991
@ -268,11 +268,11 @@ class ConnectionRouter(object):
|
|||||||
try:
|
try:
|
||||||
method = router.allow_migrate
|
method = router.allow_migrate
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
method = router.allow_syncdb
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
'Router.allow_syncdb has been deprecated and will stop working in Django 1.9.'
|
'Router.allow_syncdb has been deprecated and will stop working in Django 1.9. '
|
||||||
'Rename the method to allow_migrate.',
|
'Rename the method to allow_migrate.',
|
||||||
PendingDeprecationWarning, stacklevel=2)
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
method = router.allow_syncdb
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# If the router doesn't have a method, skip to the next one.
|
# If the router doesn't have a method, skip to the next one.
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user