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

Edit exception message when editing certain fields of a catalogue item with children #418

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def partial_update_catalogue_item(
logger.exception(message)
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail=message) from exc
except ChildElementsExistError as exc:
message = "Catalogue item has child elements and cannot be updated"
message = "Catalogue item has child elements, so the manufacturer_id and properties fields cannot be updated"
logger.exception(message)
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail=message) from exc
except InvalidActionError as exc:
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/test_catalogue_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ def test_partial_update_manufacturer_id_with_children(self):

self.patch_catalogue_item(catalogue_item_id, {"manufacturer_id": new_manufacturer_id})
self.check_patch_catalogue_item_failed_with_detail(
409, "Catalogue item has child elements and cannot be updated"
409, "Catalogue item has child elements, so the manufacturer_id and properties fields cannot be updated"
)

def test_partial_update_manufacturer_id_with_non_existent_id(self):
Expand Down Expand Up @@ -1459,7 +1459,7 @@ def test_partial_update_properties_with_children(self):

self.patch_catalogue_item(catalogue_item_id, {"properties": []})
self.check_patch_catalogue_item_failed_with_detail(
409, "Catalogue item has child elements and cannot be updated"
409, "Catalogue item has child elements, so the manufacturer_id and properties fields cannot be updated"
)

def test_partial_update_obsolete_replacement_catalogue_item_id(self):
Expand Down