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
0
Merge Requests
0
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
Jérome Perrin
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
app/services/projects/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.'
if
new_namespace
.
blank?
raise
TransferError
,
'Please select a new namespace for your project.'
end
project
.
errors
.
add
(
:new_namespace
,
error_messag
e
)
false
unless
allowed_transfer?
(
current_user
,
project
,
new_namespac
e
)
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