Commit a3b64ac69771503718f2cb7ca41b7b3be4fff2bb
1 parent
aef7dbfd
Exists in
master
and in
3 other branches
create category is working fine
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
categories/forms.py
... | ... | @@ -13,9 +13,9 @@ class CategoryForm(forms.ModelForm): |
13 | 13 | def clean_name(self): |
14 | 14 | name = self.cleaned_data.get('name') |
15 | 15 | if self.instance.id: |
16 | - same_name = Subject.objects.filter(name__unaccent__iexact = name).exclude(id = self.instance.id) | |
16 | + same_name = Category.objects.filter(name__unaccent__iexact = name).exclude(id = self.instance.id) | |
17 | 17 | else: |
18 | - same_name = Subject.objects.filter(name__unaccent__iexact = name) | |
18 | + same_name = Category.objects.filter(name__unaccent__iexact = name) | |
19 | 19 | |
20 | 20 | if same_name.count() > 0: |
21 | 21 | self._errors['name'] = [_('There is another category with this name, try another one.')] | ... | ... |