Skip to content

Conversation

@rakan-pro
Copy link

@rakan-pro rakan-pro commented Oct 29, 2025

Context

This change addresses an issue where attempting to soft-delete a provider that was already soft-deleted would result in a duplicate error.

Description

This change modifies the unique constraint on the Provider model to ensure that it only considers non-deleted entries.
A new migration has been created to reflect this change in the database schema.
Additionally, tests have been added to verify the behavior of soft deletion and the uniqueness of provider entries.

Steps to review

  1. Manual Verification (if possible): If there's an easy way to spin up the API locally, consider:
    • Creating a provider.
    • Soft-deleting that provider.
    • Attempting to create a new provider with the same unique identifier (tenant_id, provider, uid). This should succeed.
    • Attempting to create a new provider with the same unique identifier when the original is NOT soft-deleted. This should fail.
    • Soft-deleting that provider. should not fail (it was failing before due to the UniqueConstraint)

Checklist

API

  • Verify if API specs need to be regenerated.
  • Check if version updates are required (e.g., specs, Poetry, etc.).
  • Ensure new entries are added to CHANGELOG.md, if applicable.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…-deleted entries

This change modifies the unique constraint on the Provider model to ensure that it only considers non-deleted entries. A new migration has been created to reflect this change in the database schema. Additionally, tests have been added to verify the behavior of soft deletion and the uniqueness of provider entries.
@rakan-pro rakan-pro requested a review from a team as a code owner October 29, 2025 08:59
@github-actions github-actions bot added component/api review-django-migrations This PR contains changes in Django migrations community Opened by the Community labels Oct 29, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

🔒 Container Security Scan

Image: prowler-api:a83ded9
Last scan: 2025-10-29 12:38:21 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 4
Total 4

3 package(s) affected

⚠️ Action Required

Critical severity vulnerabilities detected. These should be addressed before merging:

  • Review the detailed scan results
  • Update affected packages to patched versions
  • Consider using a different base image if updates are unavailable

📋 Resources:

josemazo
josemazo previously approved these changes Oct 29, 2025
Copy link
Contributor

@josemazo josemazo left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@josemazo josemazo added the backport-to-v5.13 Backport PR to the v5.13 branch label Oct 29, 2025
@vicferpoy vicferpoy removed the community Opened by the Community label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v5.13 Backport PR to the v5.13 branch component/api review-django-migrations This PR contains changes in Django migrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants