diff options
Diffstat (limited to 'app/controllers/projects/settings')
3 files changed, 13 insertions, 2 deletions
diff --git a/app/controllers/projects/settings/integration_hook_logs_controller.rb b/app/controllers/projects/settings/integration_hook_logs_controller.rb index b3b5a292d42..1e42fbce4c4 100644 --- a/app/controllers/projects/settings/integration_hook_logs_controller.rb +++ b/app/controllers/projects/settings/integration_hook_logs_controller.rb @@ -20,7 +20,7 @@ module Projects override :hook def hook - @hook ||= integration.service_hook || not_found + @hook ||= integration.try(:service_hook) || not_found end end end diff --git a/app/controllers/projects/settings/integrations_controller.rb b/app/controllers/projects/settings/integrations_controller.rb index cee9e9feb7b..03ef434456f 100644 --- a/app/controllers/projects/settings/integrations_controller.rb +++ b/app/controllers/projects/settings/integrations_controller.rb @@ -122,7 +122,7 @@ module Projects end def web_hook_logs - return unless integration.service_hook.present? + return unless integration.try(:service_hook).present? @web_hook_logs ||= integration.service_hook.web_hook_logs.recent.page(params[:page]) end diff --git a/app/controllers/projects/settings/packages_and_registries_controller.rb b/app/controllers/projects/settings/packages_and_registries_controller.rb index d3c08bef808..76c9cead360 100644 --- a/app/controllers/projects/settings/packages_and_registries_controller.rb +++ b/app/controllers/projects/settings/packages_and_registries_controller.rb @@ -14,11 +14,22 @@ module Projects def show end + def cleanup_tags + registry_settings_enabled! + + @hide_search_settings = true + end + private def packages_and_registries_settings_enabled! render_404 unless can?(current_user, :view_package_registry_project_settings, project) end + + def registry_settings_enabled! + render_404 unless Gitlab.config.registry.enabled && + can?(current_user, :admin_container_image, project) + end end end end |