diff --git a/topics/forms.py b/topics/forms.py index 8ee1cb2..8a783aa 100644 --- a/topics/forms.py +++ b/topics/forms.py @@ -17,12 +17,12 @@ class TopicForm(forms.ModelForm): def clean_name(self): name = self.cleaned_data.get('name', '') repo = self.cleaned_data.get('repository', False) - + if self.instance.id: same_name = self.subject.topic_subject.filter(name__unaccent__iexact = name).exclude(id = self.instance.id).count() else: same_name = self.subject.topic_subject.filter(name__unaccent__iexact = name).count() - + if same_name > 0: if repo: self._errors['name'] = [_('This subject already has a repository')] @@ -38,4 +38,4 @@ class TopicForm(forms.ModelForm): fields = ['repository', 'name', 'description', 'visible' ] widgets = { 'description': forms.Textarea, - } \ No newline at end of file + } diff --git a/topics/templates/resources/list.html b/topics/templates/resources/list.html index 01cdbaf..4c8a3c5 100644 --- a/topics/templates/resources/list.html +++ b/topics/templates/resources/list.html @@ -3,15 +3,15 @@ {% subject_permissions request.user topic.subject as has_subject_permissions %} -