﻿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
19603	"Custom User model called ""User"" causes errors"	berto	nobody	"I tried creating a custom User model called User subclassing AbstractUser and ended up with m2m errors:

    [berto@g6]$ python manage.py syncdb --noinput
    CommandError: One or more models did not validate:
    someapp.user: Accessor for m2m field 'groups' clashes with related m2m
    field 'Group.user_set'. Add a related_name argument to the definition
    for 'groups'.
    someapp.user: Accessor for m2m field 'user_permissions' clashes with
    related m2m field 'Permission.user_set'. Add a related_name argument to
    the definition for 'user_permissions'.
    auth.user: Accessor for m2m field 'groups' clashes with related m2m
    field 'Group.user_set'. Add a related_name argument to the definition
    for 'groups'.
    auth.user: Accessor for m2m field 'user_permissions' clashes with
    related m2m field 'Permission.user_set'. Add a related_name argument to
    the definition for 'user_permissions'.

I have an example of this problem here:

https://github.com/rca-archive/django_custom_user_model_called_user/commit/ab23eefbe7d0eccb77a73a7598c3d41f9f6bfa1e

and it subsequently working by renaming the model here:

https://github.com/rca-archive/django_custom_user_model_called_user/commit/88f034fd35281beecf77db427845eff4da3e1ce9

If there is a reason that a custom User model has to be called something other than User, it would be great to mention that in the docs:

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#substituting-a-custom-user-model

Thanks!"	Uncategorized	closed	Uncategorized	1.4	Normal	invalid			Unreviewed	0	0	0	0	0	0
