Skip to content

Commit 8a26eec

Browse files
committed
gracefully handle org not found
1 parent 763c3bf commit 8a26eec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/controllers/organizations/base_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def require_subscription
3131

3232
def set_organization
3333
@organization = current_user.organizations.find(params[:organization_id])
34+
rescue ActiveRecord::RecordNotFound
35+
redirect_to organizations_path, alert: t("organizations.errors.not_found"), status: :not_found
3436
end
3537

3638
def set_current_membership

0 commit comments

Comments
 (0)