Skip to content

Commit

Permalink
Merge pull request #427 from Asgef/bugfix/425-fix-filter-for-issues-page
Browse files Browse the repository at this point in the history
[#425] Fix filter for "issues" page
  • Loading branch information
fey authored Jun 17, 2024
2 parents b316af9 + 3fdfc7d commit 58300b2
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions contributors/views/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,14 @@ class Meta: # noqa: WPS306

def get_good_first_issue(self, queryset, name, value): # noqa: WPS110
"""Filter issues by label 'good_first_issue'."""
good_first = ContributionLabel.objects.filter(
name='good first issue',
).first()
all_open_issues = Contribution.objects.filter(
type='iss', info__state='open',
)
if good_first is None:
queryset = all_open_issues.none()
elif value:
queryset = all_open_issues.filter(
labels__in=[good_first.id],
)
if value: # Only apply filter if checkbox is checked
good_first = ContributionLabel.objects.filter(
name='good first issue',
).first()
if good_first:
queryset = queryset.filter(
labels__in=[good_first.id], info__state='open',
)
return queryset


Expand Down

0 comments on commit 58300b2

Please sign in to comment.