Skip to content

Commit

Permalink
Merge pull request #1209 from rapidpro/fix-stories-api
Browse files Browse the repository at this point in the history
Fix stories API queryset
  • Loading branch information
norkans7 authored Apr 17, 2024
2 parents 5676b91 + 93ced4c commit d594513
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_current_msgids():
status("Running black")
cmd("black ureport")
status("Running ruff")
cmd("ruff ureport")
cmd("ruff check ureport")
status("Running isort")
cmd("isort ureport")
status("Updating locale PO files")
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ line-length = 119

[tool.ruff]
line-length = 120
select = ["E", "F", "W"]
ignore = ["E501", "F405"]
lint.select = ["E", "F", "W"]
lint.ignore = ["E501", "F405"]
fix = true
exclude = ["./.tox/*", "./.venv/*", "./env/*", "*/migrations/*", "./build/*"]

Expand Down
4 changes: 4 additions & 0 deletions ureport/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,10 @@ class StoryList(BaseListAPIView):
serializer_class = StoryReadSerializer
model = Story

def get_queryset(self):
queryset = super().get_queryset()
return queryset.filter(is_active=True).filter(Q(attachment="") | Q(attachment=None))


class StoryDetails(RetrieveAPIView):
"""
Expand Down

0 comments on commit d594513

Please sign in to comment.