cypreess/django-plans — pull request #41 by andresriancho (2014-06-23 21:25:59+00:00)
Title: Fix for Add support for Substituting a custom User model #40

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#substituting-a-custom-user-model is not supported by django-plans, since it has hard-coded references to 'auth.User'.

By default this patch doesn't do anything, since settings.AUTH_USER_MODEL defaults to auth.User, but when the developer changes the setting, it will allow him to keep using django-plans.

Without this patch, trying to run the unittests for a project that uses both settings.AUTH_USER_MODEL and django-plans returns:
```
Creating test database for alias 'default'...
CommandError: One or more models did not validate:
plans.plan: 'customized' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
plans.billinginfo: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
plans.userplan: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
plans.order: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
plans.invoice: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
```

https://github.com/cypreess/django-plans/issues/40