Skip to content
Snippets Groups Projects
Unverified Commit 00d98895 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

If registrations have been re-opened when user confirms account, approve (#10349)

parent 013a9e0b
No related branches found
No related tags found
No related merge requests found
......@@ -124,7 +124,8 @@ class User < ApplicationRecord
end
def confirm
new_user = !confirmed?
new_user = !confirmed?
self.approved = true if open_registrations?
super
......@@ -136,7 +137,8 @@ class User < ApplicationRecord
end
def confirm!
new_user = !confirmed?
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment