Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

South error on migration with custom user model #2

Open
thorin-schiffer opened this issue Dec 12, 2014 · 1 comment
Open

South error on migration with custom user model #2

thorin-schiffer opened this issue Dec 12, 2014 · 1 comment

Comments

@thorin-schiffer
Copy link

Hey folks,

while trying to migrate accounts app with

./manage.py migrate accounts

I get following error:

ValueError: Cannot successfully create field 'user' for model 'transfer': "The model 'sevenskillsuser' from the app 'users' is not available in this migration.".

'users.SevenSkillsUser' is the custom user model, inherited from auth.AbstractUser.

Django 1.6.7, accounts 0.4, south 1.0.0

Full traceback:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
    ignore_ghosts = ignore_ghosts,
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/migration/migrators.py", line 256, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/migration/migrators.py", line 331, in migrate_many
    result = self.migrate(migration, database)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration, database)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/migration/migrators.py", line 106, in run
    south.db.db.current_orm = self.orm(migration)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/migration/migrators.py", line 281, in orm
    return migration.orm()
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/utils/__init__.py", line 62, in method
    value = function(self)
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/migration/base.py", line 440, in orm
    return FakeORM(self.migration_class(), self.app_label())
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/orm.py", line 48, in FakeORM
    _orm_cache[args] = _FakeORM(*args)  
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/orm.py", line 134, in __init__
    self.retry_failed_fields()
  File "/home/eins/.virtualenvs/sevenskillsbackend/local/lib/python2.7/site-packages/south/orm.py", line 377, in retry_failed_fields
    fname, modelname, e
ValueError: Cannot successfully create field 'user' for model 'transfer': "The model 'sevenskillsuser' from the app 'users' is not available in this migration.".

Any ideas?

Thanks in advance!

@thorin-schiffer
Copy link
Author

Workaround is to turn off south migrations for accounts app in settings.py:

SOUTH_MIGRATION_MODULES = {
    'accounts': 'ignore',
}

It won't change much, because there is only initial migration in accounts app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant