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:
commit
9bdf963ce5
3 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue