Primary group retained in post json even after group removed from user


(PJH) #1

Documented here (and the next few posts): Login to your account - What the Daily WTF?

Circumstances leading to the apparent issue:

  1. Add a group to a user
  2. Make the primary group of that user that group
  3. Remove that group from the user

Observations:
a) note that on the admin screen, the user no longer has a primary group (apparently correctly removed)
b) post jsons however retain the old group as the primary:

,"display_username":"PJH","primary_group_name":"bots"

I don’t have a primary group and I’m no longer a member of bots:


(Sam Saffron) #2

Fixed via:

https://github.com/discourse/discourse/commit/e8323fa5348959688e876b2da24f18497af99db4

Might also add a consistency check for this, but for now you need add/remove group from existing users


(Sam Saffron) #3