﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22485	makemigrations fails with dependencies to unmigrated apps	Florian Apolloner	nobody	"Download the attached sample project and run ''manage.py makemigrations'':
{{{
Traceback (most recent call last):
  File ""./manage.py"", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ""/home/florian/sources/django.git/django/core/management/__init__.py"", line 427, in execute_from_command_line
    utility.execute()
  File ""/home/florian/sources/django.git/django/core/management/__init__.py"", line 419, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/home/florian/sources/django.git/django/core/management/base.py"", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/home/florian/sources/django.git/django/core/management/base.py"", line 337, in execute
    output = self.handle(*args, **options)
  File ""/home/florian/sources/django.git/django/core/management/commands/makemigrations.py"", line 99, in handle
    changes = autodetector.changes(graph=loader.graph, trim_to_apps=app_labels or None)
  File ""/home/florian/sources/django.git/django/db/migrations/autodetector.py"", line 33, in changes
    changes = self._detect_changes()
  File ""/home/florian/sources/django.git/django/db/migrations/autodetector.py"", line 50, in _detect_changes
    old_apps = self.from_state.render()
  File ""/home/florian/sources/django.git/django/db/migrations/state.py"", line 63, in render
    model=dangling_lookup[0]))
ValueError: Lookup failed for model referenced by field migrationtest.Test.user: auth.User

}}}

This is caused by https://github.com/django/django/commit/956bd644249337b9467c017aac4eec228dde8c5d (see the comments there) -- not sure if this is the actual cause or rather https://github.com/django/django/commit/2085f53f567f7619ecf3eab93fdacab7a5991a11 due to missing tests."	Bug	closed	Migrations	dev	Release blocker	fixed	migrations, unmigrated, makemigrations	Andrew Godwin Simon Charette TonyEight loic@… amusikal@… JKN rypalmer@… Ben Davis no alexander@… Kevin Brown flisky andrewhayes1979 hjwp2@… andrewsg mjrohr330@… miroslav.simek@… chockey jezevec	Accepted	0	0	0	0	0	0
