New user ban functionality calls user.project_role(project=project)
which upserts a project_role record. This is causing an unnecessary increase in project_role records. The ban logic shouldn't create new records. And potentially other uses of project_role() shouldn't be creating new records either, or at least be explicit if they need a record created.
This is causing performance issues because the number of roles for the p.--init-- project is growing, and queries from Credentials.load_project_roles
are fetching all of them which is getting slow.
allura:cj/6712