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
d0546e6d
Commit
d0546e6d
authored
Oct 24, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uypdated keys controller logic
parent
72b7b10d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
app/controllers/profiles/keys_controller.rb
app/controllers/profiles/keys_controller.rb
+2
-8
app/services/keys/base_service.rb
app/services/keys/base_service.rb
+1
-0
No files found.
app/controllers/profiles/keys_controller.rb
View file @
d0546e6d
...
...
@@ -11,10 +11,10 @@ class Profiles::KeysController < Profiles::ApplicationController
end
def
create
@key
=
Keys
::
CreateService
.
new
(
current_user
,
key_params
).
execute
@key
=
Keys
::
CreateService
.
new
(
current_user
,
key_params
.
merge
(
ip_address:
request
.
remote_ip
)
).
execute
if
@key
.
persisted?
redirect_to
_profile_key_path
redirect_to
profile_key_path
(
@key
)
else
@keys
=
current_user
.
keys
.
select
(
&
:persisted?
)
render
:index
...
...
@@ -50,12 +50,6 @@ class Profiles::KeysController < Profiles::ApplicationController
end
end
protected
def
redirect_to_profile_key_path
redirect_to
profile_key_path
(
@key
)
end
private
def
key_params
...
...
app/services/keys/base_service.rb
View file @
d0546e6d
...
...
@@ -4,6 +4,7 @@ module Keys
def
initialize
(
user
,
params
)
@user
,
@params
=
user
,
params
@ip_address
=
@params
.
delete
(
:ip_address
)
end
def
notification_service
...
...
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