Unverified Commit 6f51fd74 authored by ThibG's avatar ThibG Committed by GitHub

Fix invitation links not working when invite request text is required (#15385)

Fixes #15383
Co-authored-by: default avatarClaire <claire.github-309c@sitedethib.com>
parent 7bf3c6e5
......@@ -83,7 +83,7 @@ class User < ApplicationRecord
has_one :invite_request, class_name: 'UserInviteRequest', inverse_of: :user, dependent: :destroy
accepts_nested_attributes_for :invite_request, reject_if: ->(attributes) { attributes['text'].blank? && !Setting.require_invite_text }
validates :invite_request, presence: true, on: :create, if: -> { Setting.require_invite_text }
validates :invite_request, presence: true, on: :create, if: -> { Setting.require_invite_text && !invited? }
validates :locale, inclusion: I18n.available_locales.map(&:to_s), if: :locale?
validates_with BlacklistedEmailValidator, on: :create
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment