mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
124 stars 53 forks source link

[Bug]: Admin tools: Cannot delete ratings on changelist page when sorted by IP address #1784

Closed wagnerand closed 2 weeks ago

wagnerand commented 1 month ago

What happened?

  1. Open /admin/models/ratings/rating/?addon=<ID>&o=5
  2. Select one or more ratings.
  3. From the select box above the list, select "Delete selected ratings" and click "Go".
  4. Confirm deleting on confirmation page.
  5. FieldError: Cannot update when ordering by an aggregate: GroupConcat(Inet6Ntoa(Col(log_activity_ip, activity.IPLog.ip_address_binary)), distinct=True) (sentry)

What did you expect to happen?

Ratings deleted successfully

Is there an existing issue for this?

┆Issue is synchronized with this Jira Task

ioanarusiczki commented 2 weeks ago

I don't understand /admin/models/ratings/rating/?addon=<ID>&o=5 if I try that I don't get results but I tried with

https://addons-internal.stage.mozaws.net/en-US/admin/models/ratings/rating/?q=&deleted=false or https://addons-internal.dev.mozaws.net/en-US/admin/models/ratings/rating/?q=630776%2C630491&deleted=false

selected multiple ratings and deleted without errors.

diox commented 2 weeks ago

In /admin/models/ratings/rating/?addon=<ID>&o=5 you need to replace <ID> with an add-on id that has some ratings attached to it (with some IPs)

wagnerand commented 2 weeks ago

&o=5 means the list is sorted by IP addresses (you can achieve the same ting by clicking on the column header)

ioanarusiczki commented 2 weeks ago

ahhh 🤦🏽‍♀️ I tried with reports ids from the first column instead of the correct addon id

https://addons-internal.stage.mozaws.net/en-US/admin/models/ratings/rating/?q=&addon=1007672&o=5

on multiple ratings or a single rating is working for me on stage.

Or on dev , another example https://addons-internal.dev.mozaws.net/en-US/admin/models/ratings/rating/?q=&o=5.-3&deleted=false&addon=630148