Project

General

Profile

Actions

Defect #35606

closed

Locked users should not be displayed in the members box of the project overview page

Added by Go MAEDA over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Projects
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Before Redmine 4.2.0, members box of the project overview page did not display locked users, but it does in Redmine 4.2.0.

I think it is a bug due to #33174. In the change, the method to list members has been changed from Project#members to Project#memberships to get not only users but also groups. However, Project#members only returns active users but Project#memberships does not check the status of users/groups.

  has_many :memberships, :class_name => 'Member', :inverse_of => :project
  # Memberships of active users only
  has_many :members,
           lambda {joins(:principal).where(:users => {:type => 'User', :status => Principal::STATUS_ACTIVE})}

I think Project#principals_by_role that prepares values for the members box by using Project#memberships should exclude locked users.

Redmine 4.1:

Redmine 4.2:


Files

4_1.png (209 KB) 4_1.png Go MAEDA, 2021-07-26 11:33
4_2.png (294 KB) 4_2.png Go MAEDA, 2021-07-26 11:33
fix-35606.patch (1.3 KB) fix-35606.patch Mizuki ISHIKAWA, 2021-07-27 04:52
Actions

Also available in: Atom PDF