torchbox/wagtail — pull request #160 by v1kku (2014-03-24 23:56:16+00:00)
Title: Better support for custom AUTH_USER_MODEL

This pull carries on with the work started in [#58](https://github.com/torchbox/wagtail/pull/58/). The migrations no longer expect `auth.User` to be the User model.

In `wagtailusers.forms.UserCreationForm` a `clean_username` method has been added. It has been copied as is from the Base UserCreationForm. The reason for this is that, when called by the base UserCreationForm, it attempts to use the imported `auth.User` to check if the submitted username already exists in the db, as such it will fail if one is using a custom AUTH_USER_MODEL because it will attempt a lookup on the wrong table.

In `wagtailusers.views.users` the change_user permission string is now being generated dynamically as it previously made the assumption that `auth.User` is being used.

Tests haven't been touched.