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
f4adb14c
Commit
f4adb14c
authored
Jun 17, 2020
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove initialize method and use base service initialize
parent
f08890de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
9 deletions
+1
-9
app/services/gpg_keys/create_service.rb
app/services/gpg_keys/create_service.rb
+0
-8
lib/api/users.rb
lib/api/users.rb
+1
-1
No files found.
app/services/gpg_keys/create_service.rb
View file @
f4adb14c
...
...
@@ -2,14 +2,6 @@
module
GpgKeys
class
CreateService
<
Keys
::
BaseService
attr_accessor
:current_user
def
initialize
(
current_user
,
params
=
{})
@current_user
,
@params
=
current_user
,
params
@ip_address
=
@params
.
delete
(
:ip_address
)
@user
=
params
.
delete
(
:user
)
||
current_user
end
def
execute
key
=
user
.
gpg_keys
.
create
(
params
)
notification_service
.
new_gpg_key
(
key
)
if
key
.
persisted?
...
...
lib/api/users.rb
View file @
f4adb14c
...
...
@@ -328,7 +328,7 @@ module API
user
=
User
.
find_by
(
id:
params
.
delete
(
:id
))
not_found!
(
'User'
)
unless
user
key
=
::
GpgKeys
::
CreateService
.
new
(
current_user
,
declared_params
(
include_missing:
false
).
merge
(
user:
user
)).
execute
key
=
::
GpgKeys
::
CreateService
.
new
(
user
,
declared_params
(
include_missing:
false
)).
execute
if
key
.
persisted?
present
key
,
with:
Entities
::
GpgKey
...
...
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