-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(teams): Deduplicate project features list #112326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1122000
7525b9d
9230a2e
fbf014c
b29f15d
0c90f23
f80007d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,7 +249,9 @@ def get_attrs( | |
|
|
||
| if self._expand("projects"): | ||
| project_teams = ProjectTeam.objects.get_for_teams_with_org_cache(item_list) | ||
| projects = [pt.project for pt in project_teams] | ||
|
|
||
| # A project can be on multiple teams, dedupe before serializing | ||
| projects = list({pt.project_id: pt.project for pt in project_teams}.values()) | ||
|
|
||
| projects_by_id = { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could also do this deduping after
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (letting the clanker respond) The dedup has to happen before |
||
| project.id: data | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like this is the only user of
get_for_teams_with_org_cache, we could in theory dedupe on the query level.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(letting the clanker respond)
We still need the full join table for the
project_maploop below (line 265-267) which maps each team to its projects. If we deduped at the query level we'd lose that team-to-project mapping. Could split it into two queries but that seems worse.