Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2019-10-23 00:06:29 +00:00
parent d5e0416021
commit dffeff5520
5 changed files with 9 additions and 4 deletions

View file

@ -59,7 +59,7 @@ class User < ApplicationRecord
# Removed in GitLab 12.3. Keep until after 2019-09-22.
self.ignored_columns += %i[support_bot]
MINIMUM_INACTIVE_DAYS = 14
MINIMUM_INACTIVE_DAYS = 180
# Override Devise::Models::Trackable#update_tracked_fields!
# to limit database writes to at most once every hour

View file

@ -0,0 +1,5 @@
---
title: Increased deactivation threshold to 180 days
merge_request: 18902
author:
type: changed

View file

@ -1172,7 +1172,7 @@ Returns:
- `404 User Not Found` if user cannot be found.
- `403 Forbidden` when trying to deactivate a user:
- Blocked by admin or by LDAP synchronization.
- That has any activity in past 14 days. These cannot be deactivated.
- That has any activity in past 180 days. These users cannot be deactivated.
## Activate user

View file

@ -71,7 +71,7 @@ To do this:
Please note that for the deactivation option to be visible to an admin, the user:
- Must be currently active.
- Should not have any activity in the last 14 days.
- Should not have any activity in the last 180 days.
### Activating a user

View file

@ -123,7 +123,7 @@ describe Admin::UsersController do
put :deactivate, params: { id: user.username }
user.reload
expect(user.deactivated?).to be_falsey
expect(flash[:notice]).to eq("The user you are trying to deactivate has been active in the past 14 days and cannot be deactivated")
expect(flash[:notice]).to eq("The user you are trying to deactivate has been active in the past #{::User::MINIMUM_INACTIVE_DAYS} days and cannot be deactivated")
end
end
end