瀏覽代碼

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

master
Eugen Rochko 5 年之前
committed by GitHub
父節點
當前提交
00d988955f
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 9 行新增3 行删除
  1. +9
    -3
      app/models/user.rb

+ 9
- 3
app/models/user.rb 查看文件

@@ -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


Loading…
取消
儲存