Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3bcd20f0
Commit
3bcd20f0
authored
May 12, 2021
by
Serena Fang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove banned from blocked scope
parent
4c063349
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
app/models/user.rb
app/models/user.rb
+1
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-2
No files found.
app/models/user.rb
View file @
3bcd20f0
...
...
@@ -381,7 +381,7 @@ class User < ApplicationRecord
# Scopes
scope
:admins
,
->
{
where
(
admin:
true
)
}
scope
:instance_access_request_approvers_to_be_notified
,
->
{
admins
.
active
.
order_recent_sign_in
.
limit
(
INSTANCE_ACCESS_REQUEST_APPROVERS_TO_BE_NOTIFIED_LIMIT
)
}
scope
:blocked
,
->
{
with_states
(
:blocked
,
:ldap_blocked
,
:banned
)
}
scope
:blocked
,
->
{
with_states
(
:blocked
,
:ldap_blocked
)
}
scope
:blocked_pending_approval
,
->
{
with_states
(
:blocked_pending_approval
)
}
scope
:banned
,
->
{
with_states
(
:banned
)
}
scope
:external
,
->
{
where
(
external:
true
)
}
...
...
spec/models/user_spec.rb
View file @
3bcd20f0
...
...
@@ -736,11 +736,10 @@ RSpec.describe User do
it
'returns only blocked users'
do
expect
(
subject
).
to
include
(
blocked_user
,
banned_user
,
ldap_blocked_user
)
expect
(
subject
).
not_to
include
(
active_user
,
blocked_pending_approval_user
)
expect
(
subject
).
not_to
include
(
active_user
,
blocked_pending_approval_user
,
banned_user
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment