Fixes potential issue with custom user models

Hi,

Simple update as per title, prevents issues with custom user models.

Thanks,