Skip to content

Commit

Permalink
[api] Die ApiDetails, die
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs authored and coolo committed Oct 22, 2013
1 parent 9253702 commit d820a17
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 71 deletions.
6 changes: 3 additions & 3 deletions src/api/webui/app/controllers/webui/package_controller.rb
Expand Up @@ -692,7 +692,7 @@ def save_person
begin
@package.api_obj.add_role(load_obj, Role.find_by_title!(params[:role]))
@package.free_cache
rescue ApiDetails::TransportError, ApiDetails::NotFoundError, User::NotFound, ::Group::NotFound => e
rescue User::NotFound, ::Group::NotFound => e
flash[:error] = e.to_s
redirect_to action: :add_person, project: @project, package: @package, role: params[:role], userid: params[:userid]
return
Expand All @@ -710,7 +710,7 @@ def save_group
begin
@package.api_obj.add_role(load_obj, Role.find_by_title!(params[:role]))
@package.free_cache
rescue ApiDetails::TransportError, ApiDetails::NotFoundError, User::NotFound, ::Group::NotFound => e
rescue User::NotFound, ::Group::NotFound => e
flash[:error] = e.to_s
redirect_to action: :add_group, project: @project, package: @package, role: params[:role], groupid: params[:groupid]
return
Expand All @@ -728,7 +728,7 @@ def remove_role
begin
@package.api_obj.remove_role(load_obj, Role.find_by_title(params[:role]))
@package.free_cache
rescue ApiDetails::TransportError, ApiDetails::NotFoundError, User::NotFound, ::Group::NotFound => e
rescue User::NotFound, ::Group::NotFound => e
flash[:error] = e.summary
end
respond_to do |format|
Expand Down
6 changes: 3 additions & 3 deletions src/api/webui/app/controllers/webui/project_controller.rb
Expand Up @@ -869,7 +869,7 @@ def save_person
begin
@project.api_obj.add_role(load_obj, Role.find_by_title!(params[:role]))
@project.free_cache
rescue ApiDetails::TransportError, ApiDetails::NotFoundError, User::NotFound => e
rescue User::NotFound => e
flash[:error] = e.to_s
redirect_to action: :add_person, project: @project, role: params[:role], userid: params[:userid]
return
Expand All @@ -887,7 +887,7 @@ def save_group
begin
@project.api_obj.add_role(load_obj, Role.find_by_title!(params[:role]))
@project.free_cache
rescue ApiDetails::TransportError, ApiDetails::NotFoundError, ::Group::NotFound => e
rescue ::Group::NotFound => e
flash[:error] = e.to_s
redirect_to action: :add_group, project: @project, role: params[:role], groupid: params[:groupid]
return
Expand All @@ -905,7 +905,7 @@ def remove_role
begin
@project.api_obj.remove_role(load_obj, Role.find_by_title(params[:role]))
@project.free_cache
rescue ApiDetails::TransportError, ApiDetails::NotFoundError, User::NotFound, ::Group::NotFound => e
rescue User::NotFound, ::Group::NotFound => e
flash[:error] = e.summary
end
respond_to do |format|
Expand Down
7 changes: 0 additions & 7 deletions src/api/webui/app/controllers/webui/webui_controller.rb
Expand Up @@ -193,13 +193,6 @@ def required_parameters(*parameters)
end
end

# useful together with ApiDetails
def pick_params(*keys)
ret = {}
keys.each { |k| ret[k] = params[k] unless params[k].blank? }
ret
end

def discard_cache?
cc = request.headers['HTTP_CACHE_CONTROL']
return false if cc.blank?
Expand Down
58 changes: 0 additions & 58 deletions src/api/webui/app/models/webui/api_details.rb

This file was deleted.

0 comments on commit d820a17

Please sign in to comment.