def clean_username(self):
    username = self.cleaned_data['username']
if self.instance.username == username:
    return username
try:
    User._default_manager.get(username=username)
except User.DoesNotExist:
    pass
How to override django 'unique' error message for username in custom UserChangeForm