mirror of
https://github.com/kikobar/mastodon.git
synced 2024-12-24 14:54:13 +00:00
If registrations have been re-opened when user confirms account, approve (#10349)
This commit is contained in:
parent
013a9e0bed
commit
00d988955f
|
@ -125,6 +125,7 @@ class User < ApplicationRecord
|
|||
|
||||
def confirm
|
||||
new_user = !confirmed?
|
||||
self.approved = true if open_registrations?
|
||||
|
||||
super
|
||||
|
||||
|
@ -137,6 +138,7 @@ class User < ApplicationRecord
|
|||
|
||||
def confirm!
|
||||
new_user = !confirmed?
|
||||
self.approved = true if open_registrations?
|
||||
|
||||
skip_confirmation!
|
||||
save!
|
||||
|
@ -264,7 +266,11 @@ class User < ApplicationRecord
|
|||
private
|
||||
|
||||
def set_approved
|
||||
self.approved = Setting.registrations_mode == 'open' || invited?
|
||||
self.approved = open_registrations? || invited?
|
||||
end
|
||||
|
||||
def open_registrations?
|
||||
Setting.registrations_mode == 'open'
|
||||
end
|
||||
|
||||
def sanitize_languages
|
||||
|
|
Loading…
Reference in a new issue