Skip to content

Commit

Permalink
If registrations have been re-opened when user confirms account, appr…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and hiyuki2578 committed Oct 2, 2019
1 parent aed64c6 commit 7984c7b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def enable!
end

def confirm
new_user = !confirmed?
new_user = !confirmed?
self.approved = true if open_registrations?

super

Expand All @@ -136,7 +137,8 @@ def confirm
end

def confirm!
new_user = !confirmed?
new_user = !confirmed?
self.approved = true if open_registrations?

skip_confirmation!
save!
Expand Down Expand Up @@ -264,7 +266,11 @@ def send_devise_notification(notification, *args)
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
Expand Down

0 comments on commit 7984c7b

Please sign in to comment.