MAAS keys count in user list is bogus
Bug #1884112 reported by
Adam Collard
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Adam Collard | ||
2.7 |
New
|
Undecided
|
Unassigned | ||
2.8 |
Fix Released
|
High
|
Adam Collard |
Bug Description
MAAS version: 2.8.0~rc5 (8551-g.d0d4cdf79) but also reproducible on MAAS version: 2.7.1 (8262-g.
The count of keys shown in the User list in the UI is wrong.
Steps to reproduce
1. Create a user
2. Add two ssh keys
3. Allocate and deploy two machines
4. Visit http://
Expect to see the user, with Machines as 2, and MAAS Keys as 2
Actually see both as 4
Related branches
~adam-collard/maas:2.8-fix-1884112-count-aggregates
- Adam Collard (community): Approve
-
Diff: 80 lines (+24/-5)2 files modifiedsrc/maasserver/websockets/handlers/tests/test_user.py (+21/-3)
src/maasserver/websockets/handlers/user.py (+3/-2)
~adam-collard/maas:fix-1884112-count-aggregate
- Björn Tillenius: Approve
- MAAS Lander: Approve
- Dougal Matthews (community): Approve
-
Diff: 80 lines (+24/-5)2 files modifiedsrc/maasserver/websockets/handlers/tests/test_user.py (+21/-3)
src/maasserver/websockets/handlers/user.py (+3/-2)
Changed in maas: | |
status: | New → In Progress |
assignee: | nobody → Adam Collard (adam-collard) |
milestone: | none → 2.9.0b1 |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
importance: | Undecided → High |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
This is because .annotate() with more than one Count() is buggy - see https:/ /docs.djangopro ject.com/ en/3.0/ topics/ db/aggregation/ #combining- multiple- aggregations and https:/ /code.djangopro ject.com/ ticket/ 10060
This was introduced in 678f4b8b9549108 c8dd49af6734f50 c6671ffb80