#26881 closed Bug (fixed)
Crash when creating migrations with managers having use_in_migrations=True
Reported by: | Claude Paroz | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 1.10 |
Severity: | Release blocker | Keywords: | |
Cc: | Loic Bistuer | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Considering this model layout:
from django.db import models class PersonManager(models.Manager): use_in_migrations = True class Person(models.Model): name = models.CharField(max_length=10) objects = PersonManager() class Meta: abstract = True class BossManager(PersonManager): use_in_migrations = True class Boss(Person): objects = BossManager()
Django 1.10 crashes when calling makemigrations
:
... File "/home/claude/virtualenvs/djangogit/local/lib/python2.7/site-packages/django/db/migrations/autodetector.py", line 172, in _detect_changes self.generate_created_models() File "/home/claude/virtualenvs/djangogit/local/lib/python2.7/site-packages/django/db/migrations/autodetector.py", line 553, in generate_created_models managers=model_state.managers, File "/home/claude/virtualenvs/djangogit/local/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 64, in __init__ _check_for_duplicates('managers', (name for name, _ in self.managers)) File "/home/claude/virtualenvs/djangogit/local/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 20, in _check_for_duplicates "Found duplicate value %s in CreateModel %s argument." % (val, arg_name) ValueError: Found duplicate value objects in CreateModel managers argument.
while Django 1.9 creates the migration without problem.
Change History (6)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 8 years ago
Has patch: | set |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Thanks Loïc for your quick reaction!
Note:
See TracTickets
for help on using tickets.
Bisected to ed0ff913c648b16c4471fc9a9441d1ee48cb5420