It might be a more conservative check just to test if 'django.contrib.auth.backends.ModelBackend' is in the backends setting at all - since they cascade, and you can only have one user model per project, you shouldn't have this backend set unless you are using a compatible user model.

Also, I don't see the error condition checked in the above diff - but maybe it is already there in the original changes?