Patch from https://raw.githubusercontent.com/un33k/django-tastypie/9efaef961d5c07db85ab3882a428407eedf1c285/tastypie/compat.py to handle user models in Django 1.7+