OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#63386] Use rescue_from ActiveRecord::RecordNotFound
Dombi Attila10dc5538a2af
diff --git a/app/controllers/admin/attachments/quarantined_attachments_controller.rb b/app/controllers/admin/attachments/quarantined_attachments_controller.rbindex 80b7ec2556f..3b28ca495d5 100644--- a/app/controllers/admin/attachments/quarantined_attachments_controller.rb+++ b/app/controllers/admin/attachments/quarantined_attachments_controller.rb@@ -73,8 +73,6 @@ module Admindef find_attachment@attachment = @attachments.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404endendenddiff --git a/app/controllers/admin/custom_fields/hierarchy/items_controller.rb b/app/controllers/admin/custom_fields/hierarchy/items_controller.rbindex a23eda79907..ed67330f040 100644--- a/app/controllers/admin/custom_fields/hierarchy/items_controller.rb+++ b/app/controllers/admin/custom_fields/hierarchy/items_controller.rb@@ -146,8 +146,6 @@ module Admindef find_model_object@object = CustomField.hierarchy_root_and_children.find(params[:custom_field_id])@custom_field = @object- rescue ActiveRecord::RecordNotFound- render_404enddef find_active_item@@ -156,8 +154,6 @@ module Adminelse@object.hierarchy_rootend- rescue ActiveRecord::RecordNotFound- render_404endendenddiff --git a/app/controllers/admin/settings/project_custom_fields_controller.rb b/app/controllers/admin/settings/project_custom_fields_controller.rbindex 39b328304bd..8a53a428268 100644--- a/app/controllers/admin/settings/project_custom_fields_controller.rb+++ b/app/controllers/admin/settings/project_custom_fields_controller.rb@@ -212,8 +212,6 @@ module Admin::Settingsdef find_custom_field@custom_field = ProjectCustomField.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef drop_success_streams(call)diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex 657e26c1116..bd5793ae38c 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -133,6 +133,10 @@ class ApplicationController < ActionController::Basepayload: ::OpenProject::Logging::ThreadPoolContextBuilder.build!end+ rescue_from ActiveRecord::RecordNotFound do+ render_404+ end+before_action :authorization_check_required,:user_setup,:set_localization,@@ -240,16 +244,12 @@ class ApplicationController < ActionController::Base# Note: find() is Project.friendly.find()def find_project@project = Project.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404end# Find project of id params[:project_id]# Note: find() is Project.friendly.find()def find_project_by_project_id@project = Project.find(params[:project_id])- rescue ActiveRecord::RecordNotFound- render_404end# Finds and sets @project based on @object.project@@ -257,8 +257,6 @@ class ApplicationController < ActionController::Baserender_404 if @object.blank?@project = @object.project- rescue ActiveRecord::RecordNotFound- render_404enddef find_model_object(object_id = :id)@@ -267,8 +265,6 @@ class ApplicationController < ActionController::Base@object = model.find(params[object_id])instance_variable_set(:"@#{controller_name.singularize}", @object) if @objectend- rescue ActiveRecord::RecordNotFound- render_404enddef find_model_object_and_project(object_id = :id)@@ -280,8 +276,6 @@ class ApplicationController < ActionController::Baseelse@project = Project.find(params[:project_id])end- rescue ActiveRecord::RecordNotFound- render_404end# TODO: this method is right now only suited for controllers of objects that somehow have an association to Project@@ -295,8 +289,6 @@ class ApplicationController < ActionController::Baseassociated.each do |a|instance_variable_set("@" + a.class.to_s.downcase, a)end- rescue ActiveRecord::RecordNotFound- render_404end# this method finds all records that are specified in the associations param@@ -337,8 +329,6 @@ class ApplicationController < ActionController::Base@projects = @work_packages.filter_map(&:project).uniq@project = @projects.first if @projects.size == 1- rescue ActiveRecord::RecordNotFound- render_404enddef back_urldiff --git a/app/controllers/attribute_help_texts_controller.rb b/app/controllers/attribute_help_texts_controller.rbindex 062a2733782..1d42804a5a1 100644--- a/app/controllers/attribute_help_texts_controller.rb+++ b/app/controllers/attribute_help_texts_controller.rb@@ -109,8 +109,6 @@ class AttributeHelpTextsController < ApplicationControllerdef find_entry@attribute_help_text = AttributeHelpText.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef find_type_scopediff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rbindex 286f766e469..feb3c809d20 100644--- a/app/controllers/categories_controller.rb+++ b/app/controllers/categories_controller.rb@@ -101,7 +101,5 @@ class CategoriesController < ApplicationControllerdef find_project@project = Project.find(params[:project_id])- rescue ActiveRecord::RecordNotFound- render_404endenddiff --git a/app/controllers/concerns/accounts/authorization.rb b/app/controllers/concerns/accounts/authorization.rbindex 93320f71eb1..7bb34d46159 100644--- a/app/controllers/concerns/accounts/authorization.rb+++ b/app/controllers/concerns/accounts/authorization.rb@@ -76,8 +76,6 @@ module Accounts::Authorization@project = Project.find(params[:project_id]) if params[:project_id].present?do_authorize({ controller: controller_path, action: action_name }, global: params[:project_id].blank?)- rescue ActiveRecord::RecordNotFound- render_404end# Deny access if user is not allowed to do the specified action.@@ -214,8 +212,6 @@ module Accounts::Authorizationbefore_action(**args) do@project = Project.find(params[:project_id]) if params[:project_id].present?do_authorize(permission, global: params[:project_id].blank?)- rescue ActiveRecord::RecordNotFound- render_404endendenddiff --git a/app/controllers/concerns/custom_fields/shared_actions.rb b/app/controllers/concerns/custom_fields/shared_actions.rbindex 3fab2fca572..0c1b9553772 100644--- a/app/controllers/concerns/custom_fields/shared_actions.rb+++ b/app/controllers/concerns/custom_fields/shared_actions.rb@@ -125,8 +125,6 @@ module CustomFieldsdef find_custom_option@custom_option = CustomOption.find params[:option_id]- rescue ActiveRecord::RecordNotFound- render_404enddef delete_custom_values!(custom_option)diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rbindex c280ec2dfeb..3bf72aedf15 100644--- a/app/controllers/custom_fields_controller.rb+++ b/app/controllers/custom_fields_controller.rb@@ -75,8 +75,6 @@ class CustomFieldsController < ApplicationControllerdef find_custom_field@custom_field = CustomField.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef check_custom_fielddiff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rbindex 414248f8161..b4d7c3ba3aa 100644--- a/app/controllers/forums_controller.rb+++ b/app/controllers/forums_controller.rb@@ -125,8 +125,6 @@ class ForumsController < ApplicationControllerdef find_forum@forum = @project.forums.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef new_forumdiff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rbindex e1b49530e78..0e3ce394057 100644--- a/app/controllers/journals_controller.rb+++ b/app/controllers/journals_controller.rb@@ -59,8 +59,6 @@ class JournalsController < ApplicationControllerjournals: @journals }endend- rescue ActiveRecord::RecordNotFound- render_404enddef diff@@ -87,8 +85,6 @@ class JournalsController < ApplicationController@journal = Journal.find(params[:id])@journable = @journal.journable@project = @journable.project- rescue ActiveRecord::RecordNotFound- render_404enddef ensure_permitteddiff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rbindex 4e851f18bb9..8fd8bba3a53 100644--- a/app/controllers/news_controller.rb+++ b/app/controllers/news_controller.rb@@ -118,13 +118,9 @@ class NewsController < ApplicationControllerdef find_news_object@news = @object = News.find(params[:id].to_i)- rescue ActiveRecord::RecordNotFound- render_404enddef find_project@project = Project.find(params[:project_id])- rescue ActiveRecord::RecordNotFound- render_404endenddiff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rbindex 04686f9e908..2964cca876d 100644--- a/app/controllers/oauth/applications_controller.rb+++ b/app/controllers/oauth/applications_controller.rb@@ -115,8 +115,6 @@ module OAuthdef find_app@application = ::Doorkeeper::Application.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404endendenddiff --git a/app/controllers/placeholder_users/memberships_controller.rb b/app/controllers/placeholder_users/memberships_controller.rbindex 7b164709921..35bb55a1c08 100644--- a/app/controllers/placeholder_users/memberships_controller.rb+++ b/app/controllers/placeholder_users/memberships_controller.rb@@ -35,8 +35,6 @@ class PlaceholderUsers::MembershipsController < ApplicationControllerdef find_individual_principal@individual_principal = PlaceholderUser.find(params[:placeholder_user_id])- rescue ActiveRecord::RecordNotFound- render_404enddef redirected_to_tab(_membership)diff --git a/app/controllers/placeholder_users_controller.rb b/app/controllers/placeholder_users_controller.rbindex 65ce10e47e4..e1317bde96b 100644--- a/app/controllers/placeholder_users_controller.rb+++ b/app/controllers/placeholder_users_controller.rb@@ -146,8 +146,6 @@ class PlaceholderUsersController < ApplicationControllerdef find_placeholder_user@placeholder_user = PlaceholderUser.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404endprotecteddiff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rbindex 37682ac30da..cff4751c01b 100644--- a/app/controllers/repositories_controller.rb+++ b/app/controllers/repositories_controller.rb@@ -320,8 +320,6 @@ class RepositoriesController < ApplicationControllerendrescue OpenProject::SCM::Exceptions::SCMEmptyrender "empty"- rescue ActiveRecord::RecordNotFound- render_404rescue InvalidRevisionParamshow_error_not_foundenddiff --git a/app/controllers/users/memberships_controller.rb b/app/controllers/users/memberships_controller.rbindex 681163c3474..2daf11b1f9a 100644--- a/app/controllers/users/memberships_controller.rb+++ b/app/controllers/users/memberships_controller.rb@@ -35,8 +35,6 @@ class Users::MembershipsController < ApplicationControllerdef find_individual_principal@individual_principal = User.find(params[:user_id])- rescue ActiveRecord::RecordNotFound- render_404enddef redirected_to_tab(membership)diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rbindex c257e1949e4..3a0b2e866ef 100644--- a/app/controllers/users_controller.rb+++ b/app/controllers/users_controller.rb@@ -244,8 +244,6 @@ class UsersController < ApplicationControllerelse@user = User.find(params[:id])end- rescue ActiveRecord::RecordNotFound- render_404enddef authorize_for_userdiff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rbindex 15d5ea200f5..2c2a189a32d 100644--- a/app/controllers/versions_controller.rb+++ b/app/controllers/versions_controller.rb@@ -136,8 +136,6 @@ class VersionsController < ApplicationControllerdef find_project@project = Project.find(params[:project_id])- rescue ActiveRecord::RecordNotFound- render_404enddef retrieve_selected_type_ids(selectable_types, default_types = nil)diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rbindex f3c8853a944..a9824dca7fd 100644--- a/app/controllers/wiki_controller.rb+++ b/app/controllers/wiki_controller.rb@@ -367,8 +367,6 @@ class WikiController < ApplicationController@project = Project.find(params[:project_id])@wiki = @project.wikirender_404 unless @wiki- rescue ActiveRecord::RecordNotFound- render_404end# Finds or created the wiki page associateddiff --git a/app/controllers/work_package_relations_tab_controller.rb b/app/controllers/work_package_relations_tab_controller.rbindex 097b4b8296e..a1ce2acaa11 100644--- a/app/controllers/work_package_relations_tab_controller.rb+++ b/app/controllers/work_package_relations_tab_controller.rb@@ -51,7 +51,5 @@ class WorkPackageRelationsTabController < ApplicationControllerdef set_work_package@work_package = WorkPackage.find(params[:work_package_id])@project = @work_package.project # required for authorization via before_action- rescue ActiveRecord::RecordNotFound- render_404endenddiff --git a/app/helpers/work_packages_controller_helper.rb b/app/helpers/work_packages_controller_helper.rbindex 6e1ae6e7803..e70718cdb66 100644--- a/app/helpers/work_packages_controller_helper.rb+++ b/app/helpers/work_packages_controller_helper.rb@@ -61,8 +61,6 @@ module WorkPackagesControllerHelperrequest.format = "html"render_400(message: @query.errors.full_messages.join(". "))end- rescue ActiveRecord::RecordNotFound- render_404enddef atom_listdiff --git a/lib/individual_principals/membership_controller_methods.rb b/lib/individual_principals/membership_controller_methods.rbindex 363214626d5..e42ff8d7a67 100644--- a/lib/individual_principals/membership_controller_methods.rb+++ b/lib/individual_principals/membership_controller_methods.rb@@ -35,8 +35,6 @@ module IndividualPrincipalsdef find_membership@membership = Member.visible(current_user).find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef respond_with_service_call(call, message:)diff --git a/modules/auth_saml/app/controllers/saml/providers_controller.rb b/modules/auth_saml/app/controllers/saml/providers_controller.rbindex f0cfb72c966..6d10e816a99 100644--- a/modules/auth_saml/app/controllers/saml/providers_controller.rb+++ b/modules/auth_saml/app/controllers/saml/providers_controller.rb@@ -180,8 +180,6 @@ module Samldef find_provider@provider = Saml::Provider.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef check_provider_writablediff --git a/modules/avatars/app/controllers/avatars/users_controller.rb b/modules/avatars/app/controllers/avatars/users_controller.rbindex d4846468fc9..47355f881e2 100644--- a/modules/avatars/app/controllers/avatars/users_controller.rb+++ b/modules/avatars/app/controllers/avatars/users_controller.rb@@ -17,8 +17,6 @@ module ::Avatarsdef find_user@user = User.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404endendenddiff --git a/modules/budgets/app/controllers/budgets_controller.rb b/modules/budgets/app/controllers/budgets_controller.rbindex f820b9b9fd8..21b263e90ea 100644--- a/modules/budgets/app/controllers/budgets_controller.rb+++ b/modules/budgets/app/controllers/budgets_controller.rb@@ -199,8 +199,6 @@ class BudgetsController < ApplicationController# This function comes directly from issues_controller.rb (Redmine 0.8.4)@budget = Budget.includes(:project, :author).find_by(id: params[:id])@project = @budget.project if @budget- rescue ActiveRecord::RecordNotFound- render_404enddef find_budgets@@ -216,14 +214,10 @@ class BudgetsController < ApplicationController# TODO: let users bulk edit/move/destroy budgets from different projectsrender_error "Can not bulk edit/move/destroy cost objects from different projects" and return falseend- rescue ActiveRecord::RecordNotFound- render_404enddef find_optional_project@project = Project.find(params[:project_id]) if params[:project_id].present?- rescue ActiveRecord::RecordNotFound- render_404enddef render_item_as_json(element_id, costs, unit, project, permission)diff --git a/modules/calendar/app/controllers/calendar/calendars_controller.rb b/modules/calendar/app/controllers/calendar/calendars_controller.rbindex 373cb2bec67..4d34662cece 100644--- a/modules/calendar/app/controllers/calendar/calendars_controller.rb+++ b/modules/calendar/app/controllers/calendar/calendars_controller.rb@@ -106,8 +106,6 @@ module ::Calendar@view = Query.visible(current_user).find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404endendenddiff --git a/modules/calendar/app/controllers/calendar/ical_controller.rb b/modules/calendar/app/controllers/calendar/ical_controller.rbindex 2ebf12661bd..a250c2d01cd 100644--- a/modules/calendar/app/controllers/calendar/ical_controller.rb+++ b/modules/calendar/app/controllers/calendar/ical_controller.rb@@ -33,15 +33,10 @@ module ::Calendarno_authorization_required! :showdef show- begin- call = ::Calendar::ICalResponseService.new.call(- ical_token_string: params[:ical_token],- query_id: params[:id]- )- rescue ActiveRecord::RecordNotFound- render_404- return- end+ call = ::Calendar::ICalResponseService.new.call(+ ical_token_string: params[:ical_token],+ query_id: params[:id]+ )if call.present? && call.success?send_data call.result, filename: "openproject_calendar_#{DateTime.now.to_i}.ics"diff --git a/modules/costs/app/controllers/admin/cost_types_controller.rb b/modules/costs/app/controllers/admin/cost_types_controller.rbindex 0cb40984649..cc6cf118847 100644--- a/modules/costs/app/controllers/admin/cost_types_controller.rb+++ b/modules/costs/app/controllers/admin/cost_types_controller.rb@@ -151,8 +151,6 @@ module Admindef find_cost_type@cost_type = CostType.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef show_local_breadcrumbdiff --git a/modules/costs/app/controllers/costlog_controller.rb b/modules/costs/app/controllers/costlog_controller.rbindex b1811eb2420..531664914d3 100644--- a/modules/costs/app/controllers/costlog_controller.rb+++ b/modules/costs/app/controllers/costlog_controller.rb@@ -110,8 +110,6 @@ class CostlogController < ApplicationControllerrender_404falseend- rescue ActiveRecord::RecordNotFound- render_404enddef find_associated_objectsdiff --git a/modules/costs/app/controllers/hourly_rates_controller.rb b/modules/costs/app/controllers/hourly_rates_controller.rbindex 0b46db90a00..ae75c8a5f40 100644--- a/modules/costs/app/controllers/hourly_rates_controller.rb+++ b/modules/costs/app/controllers/hourly_rates_controller.rb@@ -172,19 +172,13 @@ class HourlyRatesController < ApplicationControllerdef find_project@project = Project.find(params[:project_id])- rescue ActiveRecord::RecordNotFound- render_404enddef find_optional_project@project = params[:project_id].blank? ? nil : Project.find(params[:project_id])- rescue ActiveRecord::RecordNotFound- render_404enddef find_user@user = params[:id] ? User.find(params[:id]) : User.current- rescue ActiveRecord::RecordNotFound- render_404endenddiff --git a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_filters_controller.rb b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_filters_controller.rbindex 2b6882dac60..3df60f92b0a 100644--- a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_filters_controller.rb+++ b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_filters_controller.rb@@ -73,8 +73,6 @@ module LdapGroupsdef find_filter@filter = SynchronizedFilter.find(params[:ldap_filter_id])- rescue ActiveRecord::RecordNotFound- render_404enddef check_eediff --git a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rbindex ec7dd07cb07..21431035e27 100644--- a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb+++ b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb@@ -52,8 +52,6 @@ module LdapGroupsdef find_group@group = SynchronizedGroup.find(params[:ldap_group_id])- rescue ActiveRecord::RecordNotFound- render_404enddef check_eediff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rbindex 68487cbe237..7e42f08ddfa 100644--- a/modules/meeting/app/controllers/meetings_controller.rb+++ b/modules/meeting/app/controllers/meetings_controller.rb@@ -439,8 +439,6 @@ class MeetingsController < ApplicationController@meeting = Meeting.includes([:project, :author, { participants: :user }, :sections, { agenda_items: :outcomes }]).find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef convert_params # rubocop:disable Metrics/AbcSize@@ -516,8 +514,6 @@ class MeetingsController < ApplicationControllerreturn unless copied_from_meeting_id@copy_from = Meeting.visible.find(copied_from_meeting_id)- rescue ActiveRecord::RecordNotFound- render_404enddef copy_attributesdiff --git a/modules/meeting/app/controllers/recurring_meetings_controller.rb b/modules/meeting/app/controllers/recurring_meetings_controller.rbindex a7cbf82bd7d..95250b2a041 100644--- a/modules/meeting/app/controllers/recurring_meetings_controller.rb+++ b/modules/meeting/app/controllers/recurring_meetings_controller.rb@@ -310,14 +310,10 @@ class RecurringMeetingsController < ApplicationControllerdef find_optional_project@project = Project.find(params[:project_id]) if params[:project_id].present?- rescue ActiveRecord::RecordNotFound- render_404enddef find_meeting@recurring_meeting = RecurringMeeting.visible.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef convert_params@@ -341,8 +337,6 @@ class RecurringMeetingsController < ApplicationControllerreturn unless copied_from_meeting_id@copy_from = Meeting.visible.find(copied_from_meeting_id)- rescue ActiveRecord::RecordNotFound- render_404enddef structured_meeting_paramsdiff --git a/modules/meeting/app/controllers/work_package_meetings_tab_controller.rb b/modules/meeting/app/controllers/work_package_meetings_tab_controller.rbindex bb92d783f02..85f127b415d 100644--- a/modules/meeting/app/controllers/work_package_meetings_tab_controller.rb+++ b/modules/meeting/app/controllers/work_package_meetings_tab_controller.rb@@ -101,8 +101,6 @@ class WorkPackageMeetingsTabController < ApplicationControllerdef set_work_package@work_package = WorkPackage.find(params[:work_package_id])@project = @work_package.project # required for authorization via before_action- rescue ActiveRecord::RecordNotFound- render_404enddef add_work_package_to_meeting_paramsdiff --git a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rbindex 074b04917e0..88d6c36c5f8 100644--- a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb+++ b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb@@ -128,8 +128,6 @@ module OpenIDConnectdef find_provider@provider = OpenIDConnect::Provider.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef default_breadcrumb; enddiff --git a/modules/team_planner/app/controllers/team_planner/team_planner_controller.rb b/modules/team_planner/app/controllers/team_planner/team_planner_controller.rbindex 6b04456e264..fb39836b507 100644--- a/modules/team_planner/app/controllers/team_planner/team_planner_controller.rb+++ b/modules/team_planner/app/controllers/team_planner/team_planner_controller.rb@@ -82,8 +82,6 @@ module ::TeamPlanner@view = Query.visible(current_user).find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef visible_plans(project = nil)diff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rbindex d224bbbde88..56d03f16700 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb@@ -99,8 +99,6 @@ module ::TwoFactorAuthentication# Get the used device for verificationdef otp_service_for_verification(user)otp_service(user, use_device: remembered_device(user))- rescue ActiveRecord::RecordNotFound- render_404falseend@@ -120,8 +118,6 @@ module ::TwoFactorAuthenticationendotp_service(@authenticated_user, use_channel: channel, use_device: device)- rescue ActiveRecord::RecordNotFound- render_404falseenddiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rbindex 194ac410309..8f0b56ed9ce 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb@@ -229,8 +229,6 @@ module ::TwoFactorAuthenticationdef find_device@device = target_user.otp_devices.find(params[:device_id])- rescue ActiveRecord::RecordNotFound- render_404enddef find_userdiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/users/two_factor_devices_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/users/two_factor_devices_controller.rbindex 2f0d521ad25..f839e48c522 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/users/two_factor_devices_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/users/two_factor_devices_controller.rb@@ -105,8 +105,6 @@ module ::TwoFactorAuthenticationdef find_user@user = User.find(params[:id])- rescue ActiveRecord::RecordNotFound- render_404enddef target_userdiff --git a/modules/webhooks/app/controllers/webhooks/outgoing/admin_controller.rb b/modules/webhooks/app/controllers/webhooks/outgoing/admin_controller.rbindex 688c61eae9a..95bdb27ebd4 100644--- a/modules/webhooks/app/controllers/webhooks/outgoing/admin_controller.rb+++ b/modules/webhooks/app/controllers/webhooks/outgoing/admin_controller.rb@@ -58,8 +58,6 @@ module Webhooksdef find_webhook@webhook = webhook_class.find(params[:webhook_id])- rescue ActiveRecord::RecordNotFound- render_404enddef webhook_class