osf.io icon indicating copy to clipboard operation
osf.io copied to clipboard

[ENG-8522] Preprints: Adding new moderator alters role for other users

Open antkryt opened this issue 5 months ago • 3 comments

Purpose

return only distinct moderators

Changes

QA Notes

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-8522

antkryt avatar Aug 08 '25 13:08 antkryt

tests passed on my local branch, please rerun tests here

antkryt avatar Aug 08 '25 13:08 antkryt

@antkryt Could you give a brief explanation about the issue and how changing the query would fix that? I am a bit confused.

adlius avatar Oct 23 '25 16:10 adlius

@adlius as far as I remember the problem was on the FE side (cosmetic). Backend returned users that are both admins and moderators return admin_group.user_set.all() | mod_group.user_set.all() and FE (ember) didn't know which one to display, admin or moderator role. My fix returns only distinct users with role "admin" if user is admin and "moderator" otherwise

antkryt avatar Oct 24 '25 10:10 antkryt