#19596: Django admin should use "_default_manager" not "objects" on csutom auth
model class.
---------------------------------+--------------------------------------
     Reporter:  anonymous        |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  contrib.auth     |                  Version:  1.5-beta-1
     Severity:  Release blocker  |               Resolution:
     Keywords:  auth, objects    |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------

Comment (by apollo13):

 For testing purposes I did put a custom usermodel into test_sqlite and
 got:
 {{{
 PYTHONPATH=.. ./runtests.py --settings=test_sqlite --failfast
 Creating test database for alias 'default'...
 Traceback (most recent call last):
   File "./runtests.py", line 323, in <module>
     options.failfast, args)
   File "./runtests.py", line 166, in django_tests
     failures = test_runner.run_tests(test_labels, extra_tests=extra_tests)
   File "/home/florian/sources/django.git2/django/test/simple.py", line
 368, in run_tests
     old_config = self.setup_databases()
   File "/home/florian/sources/django.git2/django/test/simple.py", line
 316, in setup_databases
     self.verbosity, autoclobber=not self.interactive)
   File "/home/florian/sources/django.git2/django/db/backends/creation.py",
 line 294, in create_test_db
     load_initial_data=False)
   File
 "/home/florian/sources/django.git2/django/core/management/__init__.py",
 line 161, in call_command
     return klass.execute(*args, **defaults)
   File "/home/florian/sources/django.git2/django/core/management/base.py",
 line 251, in execute
     self.validate()
   File "/home/florian/sources/django.git2/django/core/management/base.py",
 line 281, in validate
     raise CommandError("One or more models did not validate:\n%s" %
 error_text)
 django.core.management.base.CommandError: One or more models did not
 validate:
 m2m_through_regress.usermembership: 'user' defines a relation with the
 model 'auth.User', which has been swapped out. Update the relation to
 point at settings.AUTH_USER_MODEL.
 m2m_through_regress.group: 'user_members' defines a relation with the
 model 'auth.User', which has been swapped out. Update the relation to
 point at settings.AUTH_USER_MODEL.
 auth.user: Model has been swapped out for 'auth.CustomExtensionUser' which
 has not been installed or is abstract.
 multiple_database.userprofile: 'user' defines a relation with the model
 'auth.User', which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 comments.comment: 'user' has a relation with model
 auth.CustomExtensionUser, which has either not been installed or is
 abstract.
 comments.commentflag: 'user' has a relation with model
 auth.CustomExtensionUser, which has either not been installed or is
 abstract.
 modeladmin.validationtestmodel: 'users' defines a relation with the model
 'auth.User', which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 admin.logentry: 'user' has a relation with model auth.CustomExtensionUser,
 which has either not been installed or is abstract.
 admin_widgets.car: 'owner' defines a relation with the model 'auth.User',
 which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 m2m_regress.user: 'friends' defines a relation with the model 'auth.User',
 which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 admin_views.album: 'owner' defines a relation with the model 'auth.User',
 which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 extra_regress.order: 'created_by' defines a relation with the model
 'auth.User', which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 admin_filters.book: 'author' defines a relation with the model
 'auth.User', which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 admin_filters.book: 'contributors' defines a relation with the model
 'auth.User', which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 fixtures_regress.stuff: 'owner' defines a relation with the model
 'auth.User', which has been swapped out. Update the relation to point at
 settings.AUTH_USER_MODEL.
 }}}
 Do we want to support that?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19596#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to