Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRACK-249: Delete request from DB required query filter to be setup #2418

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions epictrack-api/src/api/models/work_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ class WorkIssues(BaseModelVersioned):

@classmethod
def list_issues_for_work_id(cls, work_id) -> List[WorkIssues]:
"""List all WorkIssues sorted by start_date."""
query = WorkIssues.query.filter(cls.work_id == work_id).order_by(
"""List all WorkIssues sorted by start_date, filtering out WorkIssues marked as deleted in the DB"""
query = WorkIssues.query.filter(
cls.work_id == work_id,
cls.is_deleted.is_(False)
).order_by(
cls.start_date.desc()
)
)
return query.all()
Loading