divio/django-cms — pull request #3377 by qris (2014-08-14 10:26:44+00:00)
Title: PageUserAdmin doesn't work with custom user model

We have a custom user model that has a `full_name` field instead of `first_name` and `last_name`.

When we set `CMS_PERMISSION = True`, the CMS breaks with this error:

File "/home/chris/dev/dfidbeamexchange/django/website/.ve/local/lib/python2.7/site-packages/django/contrib/admin/validation.py", line 251, in validate_list_display
% (cls.__name__, idx, field, cls.__name__, model._meta.object_name))
ImproperlyConfigured: PageUserAdmin.list_display[1], 'first_name' is not a callable or an attribute of 'PageUserAdmin' or found in the model 'PageUser'.

PageUserAdmin hard-codes the field list, which breaks it for us:

class PageUserAdmin(UserAdmin, GenericCmsPermissionAdmin):
form = PageUserForm
add_form = PageUserForm
model = PageUser

list_display = ('email', 'first_name', 'last_name', 'created_by')

What should we do here? Unregister `PageUserAdmin` and replace it with a custom one?