---
** [tickets:#8364] empty ProjectRole cleanup**
**Status:** open
**Milestone:** unreleased
**Created:** Wed Jun 03, 2020 07:16 PM UTC by Dave Brondsema
**Last Updated:** Wed Jun 03, 2020 07:16 PM UTC
**Owner:** nobody
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.
---
Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed
to https://forge-allura.apache.org/p/allura/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://forge-allura.apache.org/p/allura/admin/tickets/options. Or, if this is
a mailing list, you can unsubscribe from the mailing list.