#8364 empty ProjectRole cleanup

unreleased
open
nobody
None
General
nobody
2020-06-03
2020-06-03
No

Removing a user from a permission (e.g. via UI or from add_user_to_group.py) leaves an empty project role record like:

{ "_id" : ObjectId("5d4da66907ae31602eafd9b7"), "project_id" : ObjectId("5d4da66907ae31602eafd9b1"), "user_id" : ObjectId("538f723ff697c62562ed9a43"), "name" : null, "roles" : [ ] }

As far as I can tell that doesn't serve any purpose and should be removed. Worth testing a bit more to confirm though.

Then script up removal of those records and change ProjectRole remove code.

Semi-related add_user_to_group.py shouldn't merely flush_all(), it should flush individual records or expunge records after its done with them, so that doesn't accumulate a giant list of objects in its ming session.

Discussion


Log in to post a comment.