From 4cb66ca9dc06f454de95457978076dd31d2d3885 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 17 Nov 2020 20:53:01 -0300 Subject: [PATCH] =?UTF-8?q?si=20ya=20se=20acept=C3=B3=20la=20invitaci?= =?UTF-8?q?=C3=B3n=20volver=20al=20panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/usuaries_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/usuaries_controller.rb b/app/controllers/usuaries_controller.rb index deaa7a78..665a0ea5 100644 --- a/app/controllers/usuaries_controller.rb +++ b/app/controllers/usuaries_controller.rb @@ -104,6 +104,13 @@ class UsuariesController < ApplicationController # Aceptar la invitación def accept_invitation @site = find_site + + # Le usuarie ya aceptó la invitación + if site.usuarie?(current_usuarie) || site.invitade?(current_usuarie) + redirect_to sites_path + return + end + authorize SiteUsuarie.new(@site, current_usuarie) @site.touch if current_usuarie.rol_for_site(@site).update_attribute :temporal, false