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

👔(dashboard) enforce immutability of validated consents #332

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

ssorin
Copy link
Collaborator

@ssorin ssorin commented Jan 13, 2025

Purpose

For contractual reasons, the validated consents cannot be modified.
It is therefore necessary to block the updates of all new data and the deletion of consents if a consent has the status "VALIDATED".

Proposal

Introduced a validation mechanism to block any changes to consents with a VALIDATED status, raising a ValidationError if attempted.

  • add the custom method clean() to the Consent model and raised a ValidationError.
  • override save() method of the consent model to raised a ValidationError.
  • override delete() method of the consent model a ValidationError.
  • add tests to confirm this behavior.
  • update changelog

@ssorin ssorin self-assigned this Jan 13, 2025
@ssorin ssorin added feature needs review dashboard Item related to the Dashboard service labels Jan 13, 2025
@ssorin ssorin force-pushed the feature/dashboard/block-change-on-validated branch 2 times, most recently from e494fe9 to c954de1 Compare January 13, 2025 14:45
@ssorin ssorin requested a review from jmaupetit January 13, 2025 14:47
@ssorin ssorin marked this pull request as ready for review January 13, 2025 14:47
Copy link
Member

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

Maybe you should also ensure that a consent is not deleted, by overriding the delete() model method?

@ssorin ssorin force-pushed the feature/dashboard/block-change-on-validated branch 4 times, most recently from fdc6175 to 591e808 Compare January 14, 2025 15:00
Introduced a validation mechanism to block any changes to consents with a `VALIDATED` status, raising a `ValidationError` if attempted.
This preserves contractual integrity by ensuring such consents remain unchanged.
Updated tests to confirm this behavior.
@ssorin ssorin force-pushed the feature/dashboard/block-change-on-validated branch from 591e808 to d35aaa9 Compare January 14, 2025 15:47
@ssorin ssorin merged commit f700be3 into main Jan 14, 2025
10 checks passed
@ssorin ssorin deleted the feature/dashboard/block-change-on-validated branch January 14, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard Item related to the Dashboard service feature needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants