5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-29 08:36:22 +00:00

Merge branch 'issue-17343' into production.panel.sutty.nl

This commit is contained in:
f 2024-09-06 13:39:48 -03:00
commit 9bdf963ce5
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

View file

@ -10,8 +10,9 @@ module ExceptionHandler
included do
rescue_from SiteNotFound, with: :site_not_found
rescue_from PageNotFound, with: :page_not_found
rescue_from Pundit::NotAuthorizedError, with: :page_not_found
rescue_from Pundit::Error, with: :page_unauthorized
rescue_from Pundit::Error, with: :page_not_found
rescue_from Pundit::NotAuthorizedError, with: :page_unauthorized
rescue_from Pundit::NilPolicyError, with: :page_not_found
rescue_from ActionController::RoutingError, with: :page_not_found
rescue_from ActionController::ParameterMissing, with: :page_not_found
end

View file

@ -15,6 +15,8 @@ class PostsController < ApplicationController
# Las URLs siempre llevan el idioma actual o el de le usuarie
def default_url_options
{ locale: locale }
rescue SiteNotFound
{}
end
# @todo Mover a tu propio scope

View file

@ -29,7 +29,7 @@ class UsuariesController < ApplicationController
@usuarie = Usuarie.find(params[:id])
if @site.usuaries.count > 1
if @site.invitade?(@usuarie) || @site.usuaries.count > 1
# Mágicamente elimina el rol
@usuarie.sites.delete(@site)
else