-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(api): do not allow areas, links or thermals deletion when referenced in a binding constraint #2061
feat(api): do not allow areas, links or thermals deletion when referenced in a binding constraint #2061
Conversation
96f14d9
to
eade1f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code prevents the front-end to remove links/areas/clusters but not the scripts as they use the commands.
Looking at the code I don't think there's a nice way to implement it (PUT /commands
on a variant only add the command to the variant commands list without any verification for instance).
I think we can keep this how it is and not support the verification for /commands
, what do you think @laurent-laporte-pro ?
5e81a71
to
c393a53
Compare
75096fc
to
476f051
Compare
J'ai effectué un refactoring au niveau de la gestion des exceptions pour n'avoir qu'une seule classe d'exception Au niveau des fonctions qui contrôlent les objets référencés par des contraintes couplantes, j'ai amélioré ou ajouté une docstring. Le J'ai ajouté des tests unitaires pour avoir une meilleure couverture de tests, notamment dans le cas de la suppression d'une zone. J'ai fait aussi quelques corrections annexes qui m'ont été remontées par SonarCloud. |
…hen referenced in a bc
…hen referenced in a bc
69735d1
to
dd3761c
Compare
This reverts commit dd3761c.
…n `download_outputs`
a46229b
to
bddfaa3
Compare
context:
When an object is deleted while being referenced in a binding constraint, this may cause the study to become corrupt.
Acceptance tests
List of endpoints affected by the changes and to be tested:
/v1/studies/{uuid}/table-mode/binding-constraints
: Update binding constraints from Table Mode,/v1/studies/{uuid}/bindingconstraints/{binding_constraint_id}
: Update binding constraint,/v1/studies/{uuid}/bindingconstraints
: Create a binding constraint,/v1/studies/{uuid}/areas/{area_id}/clusters/thermal
: Remove thermal clusters for a given area,/v1//studies/{uuid}/links/{area_from}/{area_to}
: Delete a link,/v1/studies/{uuid}/areas/{area_id}
: Delete an area.