Skip to content

Commit

Permalink
fix filtering for components on adding a component search box. (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpofo authored Apr 22, 2021
1 parent e65331b commit 6174854
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controls/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class SelectedComponentsList(ListView):
template_name = 'systems/components_selected.html'
context_object_name = 'system_elements'
ordering = ['name']
paginate_by = 5
paginate_by = 25

def get_queryset(self):
"""
Expand All @@ -368,7 +368,7 @@ def get_context_data(self, **kwargs):
if self.request.user.has_perm('view_system', system):
# Retrieve primary system Project
# Temporarily assume only one project and get first project
project = system.projects.all()[0]
project = system.projects.first()
context['project'] = project
context['system'] = system
context['elements'] = Element.objects.all().exclude(element_type='system')
Expand Down
2 changes: 1 addition & 1 deletion templates/systems/components_selected.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<select class="producer_element_id" id="producer_element_id" name="producer_element_id" onchange="$(form).submit();" style="width:340px;">
<option value="None" selected disabled hidden>Select a Component</option>
{% for component in elements %}
{% if component not in system_elements %}
{% if component not in system.producer_elements %}
<option value="{{ component.id }}">{{ component.name }}</option>
{% endif %}
{% endfor %}
Expand Down

0 comments on commit 6174854

Please sign in to comment.