Merge branch 'develop' into 'master'
Fix kaehmy form error See merge request !61
This commit is contained in:
+1
-1
@@ -43,7 +43,7 @@ class KaehmyForm_Form(forms.ModelForm):
|
|||||||
def clean_custom_role_name(self):
|
def clean_custom_role_name(self):
|
||||||
"""Check that no other custom role with same name exists."""
|
"""Check that no other custom role with same name exists."""
|
||||||
custom_name = self.cleaned_data.get('custom_role_name')
|
custom_name = self.cleaned_data.get('custom_role_name')
|
||||||
if CustomKaehmyRole.objects.get(name=custom_name) is None:
|
if not CustomKaehmyRole.objects.filter(name=custom_name).exists():
|
||||||
return custom_name
|
return custom_name
|
||||||
else:
|
else:
|
||||||
raise ValidationError(_('Custom role with the same name already exists.'))
|
raise ValidationError(_('Custom role with the same name already exists.'))
|
||||||
|
|||||||
Reference in New Issue
Block a user