Skip to content

Commit

Permalink
Merge pull request #86 from intuitem/fix/policies-queryset
Browse files Browse the repository at this point in the history
Fix Policies queryset
  • Loading branch information
eric-intuitem authored Feb 28, 2024
2 parents a5bf729 + b2b5220 commit 71977c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,9 @@ def get_linked_requirements_count(self):


class PolicyManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(category="policy")

def create(self, *args, **kwargs):
kwargs["category"] = "policy" # Ensure category is always "policy"
return super().create(*args, **kwargs)
Expand Down

0 comments on commit 71977c6

Please sign in to comment.