hub: public pages: the kept-role-name rule from project_roles, roles read once per render, one gone-agent holder rule
tsk-p96evqvzm24y Proposed
Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: duplication.
What is wrong
- The rule "a custom role that keeps a built-in name" is
project_roles.custom_of(project_roles.py:59), used byguideandrules. The public pages spell it again:public_members.py:40(row.role in ROLES and row.role_base != row.role). public_projects.team_details(public_projects.py:248-255) re-reads all active memberships to rebuildrolesandcustom, althoughrender_projectalready holdswhowithroleandrole_custom; the re-read also takes isolated memberships and keys by principal.- "A holder not among
whothat was an agent membership" is written twice:public_project_views._gone_agents(public_project_views.py:48-64, batch) andpublic_cards._gone_agent(public_cards.py:173-180, one per card).
Proposal
render_projectusesPerson.role/Person.role_custom; drop the roles query fromteam_details; computerole_customthrough one helper next tocustom_of.- One gone-agent helper in
public_memberstaking a set of membership ids; the card page passes its one holder.
Effort / risk: S. Low; page bytes guarded by the digest tests.