diff --git a/contributors/views/repositories_views/repositories.py b/contributors/views/repositories_views/repositories.py index 763599f..b189300 100644 --- a/contributors/views/repositories_views/repositories.py +++ b/contributors/views/repositories_views/repositories.py @@ -46,6 +46,11 @@ def get_queryset(self): Prefetch('labels', queryset=Label.objects.only('name')) ) ) + + filtered_labels = self.request.GET.get('labels') + if filtered_labels: + queryset = queryset.filter( + labels__name__lower__in=filtered_labels.split('.')) return queryset template_name = 'contributors_sections/repositories/repositories_list.html' @@ -69,6 +74,10 @@ def get_context_data(self, **kwargs): repository__in=self.get_queryset(), ).distinct().only('name') + filtered_labels = self.request.GET.get('labels') + if filtered_labels: + labels = labels.filter(name__lower__in=filtered_labels.split('.')) + context['all_labels'] = all_labels context['labels'] = labels