ohcnetwork / care

Care is a Digital Public Good enabling TeleICU & Decentralised Administration of Healthcare Capacity across States.
https://careapi.ohc.network/swagger
MIT License
247 stars 291 forks source link

Manually cascade delete M2M models when related model is deleted. #1330

Open rithviknishad opened 1 year ago

rithviknishad commented 1 year ago

Describe the bug Currently, most M2M models are not deleted when their related model is deleted. The on_delete doesn't take effect as we use soft delete for all the models that inherits from BaseModel.

Expected behavior ModelAB should be updated to deleted=True when ModelA or ModelB is deleted.

Many to Many models in CARE that are potentially having this issue.

himanshu-sharmav commented 3 days ago

hi @rithviknishad can I work on this issue?