Adapted to work with custom user model