Skip to content
Browse files

Silence deprecation warnings.

Also they should only be raised if allow_syncdb does exist, not just if
allow_migrate does not.

Refs comments on 2508410
  • Loading branch information...
1 parent d256220 commit d238ab29915b24bb717b3fdc2d552c65a43ba9ab @mjtamlyn mjtamlyn committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/utils.py
View
4 django/db/utils.py
@@ -268,11 +268,11 @@ def allow_migrate(self, db, model):
try:
method = router.allow_migrate
except AttributeError:
+ method = router.allow_syncdb
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.',
PendingDeprecationWarning, stacklevel=2)
- method = router.allow_syncdb
except AttributeError:
# If the router doesn't have a method, skip to the next one.
pass

0 comments on commit d238ab2

Please sign in to comment.
Something went wrong with that request. Please try again.