﻿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
22848	Admin initial migration can't find AUTH_USER_MODEL when running makemigrations for the first time	Vidir Valberg Gudmundsson	nobody	"Defining a custom user model (in app 'testapp' and with settings.AUTH_USER_MODEL = 'testapp.CustomUser'):

{{{
from django.db import models
from django.contrib.auth.models import AbstractUser

class CustomUser(AbstractUser):
    foo = models.CharField(max_length=255)
}}}

And trying to make an initial migration, results in an error:

{{{
$ ./manage.py makemigrations
Traceback (most recent call last):
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/db/migrations/loader.py"", line 155, in check_key
    return list(self.graph.root_nodes(key[0]))[0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ""./manage.py"", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/core/management/__init__.py"", line 385, in execute_from_command_line
    utility.execute()
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/core/management/__init__.py"", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/core/management/base.py"", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/core/management/base.py"", line 337, in execute
    output = self.handle(*args, **options)
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/core/management/commands/makemigrations.py"", line 54, in handle
    loader = MigrationLoader(None)
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/db/migrations/loader.py"", line 47, in __init__
    self.build_graph()
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/db/migrations/loader.py"", line 224, in build_graph
    parent = self.check_key(parent, key[0])
  File ""/Users/valberg/.virtualenvs/django17/lib/python3.4/site-packages/django/db/migrations/loader.py"", line 159, in check_key
    raise ValueError(""Dependency on app with no migrations: %s"" % key[0])
ValueError: Dependency on app with no migrations: testapp
}}}"	Bug	closed	Migrations	dev	Release blocker	fixed			Unreviewed	1	0	1	1	0	0
