Opened 6 years ago

Closed 6 years ago

#30384 closed Bug (invalid)

Django 1.11 Upgrade -> runserver Error in db/models/fields/related.py _check_table_uniqueness

Reported by: Eric Neumann Owned by: nobody
Component: Database layer (models, ORM) Version: 1.11
Severity: Normal Keywords: AttributeError: 'ModelOptions' object has no attribute 'managed'
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello,

I'm currently upgrading from Django 1.10 to 1.11. I've addressed all deprecation issues and everything is working fine, our app is running on gunicorn and django shell works. However, runserver is throwing an error that I can't seem to sort out. Looks like it's happening on the related groups field to the user model. We are using a custom user model which was working fine in 1.10. Below is the stack trace. Appreciate any help in getting this resolved. Cheers!

Unhandled exception in thread started by <function wrapper at 0x7f6d8b8358c0>
Traceback (most recent call last):

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 227, in wrapper

fn(*args, kwargs)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run

self.check(display_num_errors=True)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check

include_deployment_checks=include_deployment_checks,

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks

return checks.run_checks(kwargs)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks

new_errors = check(app_configs=app_configs)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/checks/model_checks.py", line 30, in check_all_models

errors.extend(model.check(kwargs))

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/base.py", line 1282, in check

errors.extend(cls._check_fields(kwargs))

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/base.py", line 1359, in _check_fields

errors.extend(field.check(from_model=cls, kwargs))

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 1195, in check

errors.extend(self._check_table_uniqueness(kwargs))

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 1446, in _check_table_uniqueness

for model in self.opts.apps.get_models(include_auto_created=True)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 1447, in <dictcomp>

if model != self.remote_field.through and model._meta.managed

AttributeError: 'ModelOptions' object has no attribute 'managed'

Change History (1)

comment:1 by Simon Charette, 6 years ago

Resolution: invalid
Status: newclosed

Neither Django master or 1.11.x define a ModelOptions class so I assume one of your INSTALLED_APPS is to blame.

In all cases 1.11 is currently only receiving security backports at this point and this ticket tracker is only meant to be used to report confirmed bugs and not as a second tier support channel.

Please use one of our support channels to get further assistance.

Note: See TracTickets for help on using tickets.
Back to Top