MAAS keys count in user list is bogus

Bug #1884112 reported by Adam Collard
6
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.9a49af7df-0ubuntu1~18.04.1)

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://YOUR-REGION/MAAS/r/settings/users

Expect to see the user, with Machines as 2, and MAAS Keys as 2

Actually see both as 4

Tags: ui

Related branches

Revision history for this message
Adam Collard (adam-collard) wrote :

This is because .annotate() with more than one Count() is buggy - see https://docs.djangoproject.com/en/3.0/topics/db/aggregation/#combining-multiple-aggregations and https://code.djangoproject.com/ticket/10060

This was introduced in 678f4b8b9549108c8dd49af6734f50c6671ffb80

tags: added: ui
Revision history for this message
Adam Collard (adam-collard) wrote :

Although this affects the UI, the bug is wholly on the backend.

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
Lee Trager (ltrager)
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.