If registrations have been re-opened when user confirms account, approve (#10349)
This commit is contained in:
parent
013a9e0bed
commit
00d988955f
|
@ -124,7 +124,8 @@ class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def confirm
|
def confirm
|
||||||
new_user = !confirmed?
|
new_user = !confirmed?
|
||||||
|
self.approved = true if open_registrations?
|
||||||
|
|
||||||
super
|
super
|
||||||
|
|
||||||
|
@ -136,7 +137,8 @@ class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def confirm!
|
def confirm!
|
||||||
new_user = !confirmed?
|
new_user = !confirmed?
|
||||||
|
self.approved = true if open_registrations?
|
||||||
|
|
||||||
skip_confirmation!
|
skip_confirmation!
|
||||||
save!
|
save!
|
||||||
|
@ -264,7 +266,11 @@ class User < ApplicationRecord
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_approved
|
def set_approved
|
||||||
self.approved = Setting.registrations_mode == 'open' || invited?
|
self.approved = open_registrations? || invited?
|
||||||
|
end
|
||||||
|
|
||||||
|
def open_registrations?
|
||||||
|
Setting.registrations_mode == 'open'
|
||||||
end
|
end
|
||||||
|
|
||||||
def sanitize_languages
|
def sanitize_languages
|
||||||
|
|
Loading…
Reference in New Issue