diff options
author | ThibG <thib@sitedethib.com> | 2020-12-21 00:47:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 00:47:02 +0100 |
commit | 6f51fd743590c8fd8dd95e48dc24e4472d46480b (patch) | |
tree | 091e29465b29925016052ee25114470c17e31a4b /app | |
parent | 7bf3c6e57b52cd9390f2140a1cc17292c281aacf (diff) |
Fix invitation links not working when invite request text is required (#15385)
Fixes #15383 Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 6088f1994..dd96bbf8c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 |