Changes to make it compatible with Django User > 1.4