Commit 87f964a8 by Jan De Bleser

Fixed problem with cleaning the username when the application is using a custom username field.

parent e9495a8f
...@@ -392,7 +392,8 @@ class PermissionsForm(PluginSettingsFormMixin, forms.ModelForm): ...@@ -392,7 +392,8 @@ class PermissionsForm(PluginSettingsFormMixin, forms.ModelForm):
username = self.cleaned_data['owner_username'] username = self.cleaned_data['owner_username']
if username: if username:
try: try:
user = User.objects.get(username=username) kwargs = {User.USERNAME_FIELD: username}
user = User.objects.get(**kwargs)
except User.DoesNotExist: except User.DoesNotExist:
raise forms.ValidationError(ugettext('No user with that username')) raise forms.ValidationError(ugettext('No user with that username'))
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment