#25686: Database router without "allow_migrate" method raises exception
-------------------------------+---------------------------
     Reporter:  jcugat         |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.8
     Severity:  Normal         |   Keywords:  allow_migrate
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+---------------------------
 It seems Django 1.8.6 has introduced an error when using a database router
 that doesn't have a "allow_migrate" method. The router we are using is
 [https://github.com/jbalogh/django-multidb-
 router/blob/master/multidb/__init__.py#L83 PinningMasterSlaveRouter],
 which has a "allow_syncdb" method but no "allow_migrate". This was working
 with Django 1.8.5 (as seen in #24532), and it seems that the commit which
 introduced this is
 
[https://github.com/django/django/commit/e2ea30c4403fca1b0a2032aae7a783f8705fc08b
 e2ea30c].

 The traceback:

 {{{
 ./manage.py migrate
 Traceback (most recent call last):
   File "./manage.py", line 15, in <module>
     execute_from_command_line(sys.argv)
   File "/opt/lib/python2.7/site-
 packages/django/core/management/__init__.py", line 354, in
 execute_from_command_line
     utility.execute()
   File "/opt/lib/python2.7/site-
 packages/django/core/management/__init__.py", line 346, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/opt/lib/python2.7/site-packages/django/core/management/base.py",
 line 394, in run_from_argv
     self.execute(*args, **cmd_options)
   File "/opt/lib/python2.7/site-
 packages/raven/contrib/django/management/__init__.py", line 41, in
 new_execute
     return original_func(self, *args, **kwargs)
   File "/opt/lib/python2.7/site-packages/django/core/management/base.py",
 line 444, in execute
     self.check()
   File "/opt/lib/python2.7/site-packages/django/core/management/base.py",
 line 482, in check
     include_deployment_checks=include_deployment_checks,
   File "/opt/lib/python2.7/site-packages/django/core/checks/registry.py",
 line 72, in run_checks
     new_errors = check(app_configs=app_configs)
   File "/opt/lib/python2.7/site-
 packages/django/core/checks/model_checks.py", line 28, in check_all_models
     errors.extend(model.check(**kwargs))
   File "/opt/lib/python2.7/site-packages/django/db/models/base.py", line
 1207, in check
     errors.extend(cls._check_long_column_names())
   File "/opt/lib/python2.7/site-packages/django/db/models/base.py", line
 1610, in _check_long_column_names
     if not router.allow_migrate_model(db, cls):
   File "/opt/lib/python2.7/site-packages/django/db/utils.py", line 367, in
 allow_migrate_model
     model=model,
   File "/opt/lib/python2.7/site-packages/django/db/utils.py", line 343, in
 allow_migrate
     argspec = inspect.getargspec(router.allow_migrate)
 AttributeError: 'PinningMasterSlaveRouter' object has no attribute
 'allow_migrate'
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25686>
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/049.717548ac939bd7680a2d3dee8c8e7c8d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to