[ENG-8522] Preprints: Adding new moderator alters role for other users
Purpose
return only distinct moderators
Changes
QA Notes
Documentation
Side Effects
Ticket
https://openscience.atlassian.net/browse/ENG-8522
tests passed on my local branch, please rerun tests here
@antkryt Could you give a brief explanation about the issue and how changing the query would fix that? I am a bit confused.
@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