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

Exclude deleted Entities from form's manifest data #2648

Merged
merged 12 commits into from
Jul 25, 2024

Conversation

kelvin-muchiri
Copy link
Contributor

@kelvin-muchiri kelvin-muchiri commented Jul 23, 2024

Changes / Features implemented

Exclude deleted EntityList and Entity in the endpoints:

  1. Exclude deleted EntityList on endpoint:/<username>/xformsManifest/<form_id>
  2. Exclude deleted Entity on endpoint:/<username>/xformsMedia/<form_id>/<media_id>.csv
  3. Exclude deleted EntityList on endpoint /api/v1/projects

Created index for deleted_at column on model EntityList and Entity

Steps taken to verify this change does what is intended

  • QA

Before submitting this PR for review, please make sure you have:

  • Included tests
  • Updated documentation

Closes #2649

@kelvin-muchiri kelvin-muchiri changed the title Exclude deleted EntityList and Entity in externally facing queries Exclude deleted EntityList and Entity in endpoints and exports Jul 23, 2024
@kelvin-muchiri kelvin-muchiri changed the title Exclude deleted EntityList and Entity in endpoints and exports Exclude deleted Entities in endpoints and exports Jul 23, 2024
@kelvin-muchiri kelvin-muchiri changed the title Exclude deleted Entities in endpoints and exports Exclude soft deleted Entities in endpoints and exports Jul 23, 2024
@kelvin-muchiri kelvin-muchiri changed the title Exclude soft deleted Entities in endpoints and exports Exclude deleted Entities in endpoints and exports Jul 23, 2024
@kelvin-muchiri kelvin-muchiri marked this pull request as ready for review July 24, 2024 14:57
@kelvin-muchiri kelvin-muchiri changed the title Exclude deleted Entities in endpoints and exports Exclude deleted Entities from form's manifest data Jul 24, 2024
queryset = obj.follow_up_forms.all()
queryset = obj.follow_up_forms.filter(
entity_list__deleted_at__isnull=True
).all()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the .all() necessary?

@kelvin-muchiri kelvin-muchiri merged commit 98064d1 into main Jul 25, 2024
10 checks passed
@kelvin-muchiri kelvin-muchiri deleted the exclude-deleted-entity-list branch July 25, 2024 11:31
@FrankApiyo FrankApiyo mentioned this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleted Entities are present in the manifest dataset
2 participants