You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The member_list action with 'object_type': 'user' returns all member users, including deleted ones
This was fixed with #3078 but relies on the user_delete action.
If I manually delete a user from the DB, this will fail.
Steps to reproduce
Trying to iterate all members, you will get toolkit.ObjectNotFound for deleted users
To mimic the behaviour at the Python level introduced in #3078 (mark membership records as deleted when you delete a user via user_delete) we need to implement a foreign key with the proper CASCADE behaviour between the user and member tables.
Additionally we can add an extra check to the SQLAlchemy query in member_list that filters member records who don't have a record in the user table.
The same fix can probably be applied for datasets
CKAN version
2.9.7
Describe the bug
The
member_list
action with'object_type': 'user'
returns all member users, including deleted onesThis was fixed with #3078 but relies on the
user_delete
action.If I manually delete a user from the DB, this will fail.
Steps to reproduce
Trying to iterate all members, you will get
toolkit.ObjectNotFound
for deleted usersExpected behavior
member_list
action must return only active usersPossible fix
Add an extra DB query to filter only active users
The text was updated successfully, but these errors were encountered: