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
bd7e7e8f
Commit
bd7e7e8f
authored
Feb 01, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EE] Reduce diff with CE in Groups::CreateService
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
8850e61c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
app/services/groups/create_service.rb
app/services/groups/create_service.rb
+7
-5
ee/app/services/ee/groups/create_service.rb
ee/app/services/ee/groups/create_service.rb
+7
-0
No files found.
app/services/groups/create_service.rb
View file @
bd7e7e8f
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
module
Groups
module
Groups
class
CreateService
<
Groups
::
BaseService
class
CreateService
<
Groups
::
BaseService
prepend
::
EE
::
Groups
::
CreateService
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
initialize
(
user
,
params
=
{})
def
initialize
(
user
,
params
=
{})
@current_user
,
@params
=
user
,
params
.
dup
@current_user
,
@params
=
user
,
params
.
dup
@chat_team
=
@params
.
delete
(
:create_chat_team
)
@chat_team
=
@params
.
delete
(
:create_chat_team
)
...
@@ -12,9 +10,7 @@ module Groups
...
@@ -12,9 +10,7 @@ module Groups
def
execute
def
execute
@group
=
Group
.
new
(
params
)
@group
=
Group
.
new
(
params
)
# Repository size limit comes as MB from the view
after_build_hook
(
@group
,
params
)
limit
=
params
.
delete
(
:repository_size_limit
)
@group
.
repository_size_limit
=
Gitlab
::
Utils
.
try_megabytes_to_bytes
(
limit
)
if
limit
unless
can_use_visibility_level?
&&
can_create_group?
unless
can_use_visibility_level?
&&
can_create_group?
return
@group
return
@group
...
@@ -36,6 +32,10 @@ module Groups
...
@@ -36,6 +32,10 @@ module Groups
private
private
def
after_build_hook
(
group
,
params
)
# overriden in EE
end
def
create_chat_team?
def
create_chat_team?
Gitlab
.
config
.
mattermost
.
enabled
&&
@chat_team
&&
group
.
chat_team
.
nil?
Gitlab
.
config
.
mattermost
.
enabled
&&
@chat_team
&&
group
.
chat_team
.
nil?
end
end
...
@@ -69,3 +69,5 @@ module Groups
...
@@ -69,3 +69,5 @@ module Groups
end
end
end
end
end
end
Groups
::
CreateService
.
prepend
(
EE
::
Groups
::
CreateService
)
ee/app/services/ee/groups/create_service.rb
View file @
bd7e7e8f
...
@@ -12,6 +12,13 @@ module EE
...
@@ -12,6 +12,13 @@ module EE
private
private
override
:after_build_hook
def
after_build_hook
(
group
,
params
)
# Repository size limit comes as MB from the view
limit
=
params
.
delete
(
:repository_size_limit
)
group
.
repository_size_limit
=
::
Gitlab
::
Utils
.
try_megabytes_to_bytes
(
limit
)
if
limit
end
def
log_audit_event
def
log_audit_event
::
AuditEventService
.
new
(
::
AuditEventService
.
new
(
current_user
,
current_user
,
...
...
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