From 022b58bb3867a68784e9f32d26898b1a780962be Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sat, 7 Dec 2024 12:43:08 +0100 Subject: [PATCH] Fix issues with tenant during registration --- app/controllers/captcha_controller.rb | 2 +- app/controllers/users/registrations_controller.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/captcha_controller.rb b/app/controllers/captcha_controller.rb index 428328d..351b324 100644 --- a/app/controllers/captcha_controller.rb +++ b/app/controllers/captcha_controller.rb @@ -2,7 +2,7 @@ class CaptchaController < ApplicationController skip_before_action :authenticate_user! - + skip_before_action :set_tenant def create id = LibreCaptcha.new.get_id render json: { diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 4894d4b..0aae89d 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -7,7 +7,7 @@ class Users::RegistrationsController < Devise::RegistrationsController before_action :validate_captcha!, only: :create def create - wedding = Wedding.create(wedding_params) + wedding = Wedding.create(slug: params[:slug]) unless wedding.persisted? render json: { errors: wedding.errors.full_messages }, status: :unprocessable_entity return @@ -22,7 +22,7 @@ class Users::RegistrationsController < Devise::RegistrationsController private - def wedding_params - { slug: params[:slug], **params.expect(wedding: :date) } + def set_tenant + set_current_tenant(nil) end end \ No newline at end of file