Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Raise (pending) deprecation warning for allow_syncdb.

  • Loading branch information...
commit 250841017c6c456806cadd214b4e130aa998233d 1 parent 2085f53
@mjtamlyn mjtamlyn authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/db/utils.py
View
4 django/db/utils.py
@@ -268,6 +268,10 @@ def allow_migrate(self, db, model):
try:
method = router.allow_migrate
except AttributeError:
+ warnings.warn(
+ '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.

3 comments on commit 2508410

@timgraham
Owner

Could you silence or fix these warnings when running the tests with -Wall?

/home/tim/code/django/tests/multiple_database/tests.py:1027: PendingDeprecationWarning: Router.allow_syncdb has been deprecated and will stop working in Django 1.9.Rename the method to allow_migrate.
  self.assertFalse(router.allow_migrate('default', User))
/home/tim/code/django/tests/multiple_database/tests.py:1028: PendingDeprecationWarning: Router.allow_syncdb has been deprecated and will stop working in Django 1.9.Rename the method to allow_migrate.
  self.assertTrue(router.allow_migrate('default', Book))
@alex
Collaborator

@timgraham @mjtamlyn I believe: http://bpaste.net/show/177298/ fixes teh issue correctly. If it looks ok, I'll go ahead and commit it?

@mjtamlyn
Collaborator

@alex Just pushed basically that d238ab2

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