django-river icon indicating copy to clipboard operation
django-river copied to clipboard

Deleting the selected flow would require deleting the following protected related objects

Open rupin opened this issue 5 years ago • 5 comments
trafficstars

I am trying to delete the entries associated with the model that has the Statefield. I am unable to delete them, because the TransitionalApproval Objects are protected. Please see a video of this in action here.

https://youtu.be/Sin5zWeC0QU

Is this a setting?

My Django River version is django-river==3.2.0

rupin avatar May 24 '20 08:05 rupin

They are protected objects but I found that you can do a filter for the object_id relating to the state field object and delete all records of TransitionalApprovals model and it will allow you to delete the record

cyberdude86 avatar May 24 '20 20:05 cyberdude86

Will this be need to be done from the database by issuing queries? I don't have access to it on my instance.

rupin avatar May 25 '20 06:05 rupin

I do a direct query and then delete each result in order to allow me to delete the parent

cyberdude86 avatar May 25 '20 20:05 cyberdude86

This is a dangerous operation since you can accidentally delete critical things if it was that easy but the reason those objects are protected is that they might be used by other objects. But it should definitely be documented to at least how to do this manually.

javrasya avatar Jun 02 '20 07:06 javrasya

I agree that, even if it's not available directly, it should be documented how to safely do this

ghost avatar Aug 27 '20 15:08 ghost