mozilla / django-badger

django-badger is a reusable Django app for creating and awarding badges. See also badges.mozilla.org
https://github.com/mozilla/django-badger
BSD 3-Clause "New" or "Revised" License
117 stars 61 forks source link

Use Django's AUTH_USER_MODEL rather than the default User model #185

Open borwick opened 11 years ago

borwick commented 11 years ago

As referenced in the Django documentation: https://docs.djangoproject.com/en/dev/topics/auth/customizing/#auth-custom-user

Instead of referring to User directly, you should reference the user model using django.contrib.auth.get_user_model(). This method will return the currently active User model – the custom User model if one is specified, or User otherwise.

When you define a foreign key or many-to-many relations to the User model, you should specify the custom model using the AUTH_USER_MODEL setting. For example:

lmorchard commented 11 years ago

Hmm, looks like this fails tests under Django 1.4, which we still need to support. Will need to take a look at how to stay backwards compatible