BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ad802385
Commit
ad802385
authored
May 22, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored transfer_service #execute action
parent
acd573f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
transfer_service.rb
app/services/projects/transfer_service.rb
+6
-10
No files found.
app/services/projects/transfer_service.rb
View file @
ad802385
...
...
@@ -12,17 +12,13 @@ module Projects
TransferError
=
Class
.
new
(
StandardError
)
def
execute
(
new_namespace
)
if
!
new_namespace
.
blank?
&&
allowed_transfer?
(
current_user
,
project
,
new_namespace
)
transfer
(
project
,
new_namespace
)
else
error_message
=
if
new_namespace
.
blank?
'Please select a new namespace for your project.'
else
'Transfer failed, please contact an admin.'
end
project
.
errors
.
add
(
:new_namespace
,
error_message
)
false
if
new_namespace
.
blank?
raise
TransferError
,
'Please select a new namespace for your project.'
end
unless
allowed_transfer?
(
current_user
,
project
,
new_namespace
)
raise
TransferError
,
'Transfer failed, please contact an admin.'
end
transfer
(
project
,
new_namespace
)
rescue
Projects
::
TransferService
::
TransferError
=>
ex
project
.
reload
project
.
errors
.
add
(
:new_namespace
,
ex
.
message
)
...
...
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