Commit aef7dbfd5cfc789d412444df011d557ec63cffb6
1 parent
de22fa0c
Exists in
master
and in
3 other branches
Some adjusts
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
subjects/templates/subjects/list.html
... | ... | @@ -154,6 +154,9 @@ |
154 | 154 | <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content"> |
155 | 155 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> |
156 | 156 | <input type="hidden" class="log_id" value="" /> |
157 | + | |
158 | + <input type="hidden" class="load_sub_url" value="{% url 'subjects:load_view' category.slug %}" /> | |
159 | + | |
157 | 160 | {% if category.coordinators.all|length > 0 %} |
158 | 161 | <h4><b>{% trans "Coordinator(s) " %}: </b> |
159 | 162 | {{ category.coordinators.all|join:', ' }} | ... | ... |
topics/forms.py
... | ... | @@ -19,9 +19,9 @@ class TopicForm(forms.ModelForm): |
19 | 19 | repo = self.cleaned_data.get('repository', False) |
20 | 20 | |
21 | 21 | if self.instance.id: |
22 | - same_name = len(self.subject.topic_subject.filter(name__unaccent__iexact = name).exclude(id = self.instance.id)) | |
22 | + same_name = self.subject.topic_subject.filter(name__unaccent__iexact = name).exclude(id = self.instance.id).count() | |
23 | 23 | else: |
24 | - same_name = len(self.subject.topic_subject.filter(name__unaccent__iexact = name)) | |
24 | + same_name = self.subject.topic_subject.filter(name__unaccent__iexact = name).count() | |
25 | 25 | |
26 | 26 | if same_name > 0: |
27 | 27 | if repo: | ... | ... |