Ignore legacy moderator and admin columns on User model (#29188)
This commit is contained in:
parent
476a043fc5
commit
e8b66a0525
3 changed files with 11 additions and 2 deletions
|
@ -25,7 +25,15 @@ module User::LdapAuthenticable
|
||||||
resource = joins(:account).find_by(accounts: { username: safe_username })
|
resource = joins(:account).find_by(accounts: { username: safe_username })
|
||||||
|
|
||||||
if resource.blank?
|
if resource.blank?
|
||||||
resource = new(email: attributes[Devise.ldap_mail.to_sym].first, agreement: true, account_attributes: { username: safe_username }, admin: false, external: true, confirmed_at: Time.now.utc)
|
resource = new(
|
||||||
|
email: attributes[Devise.ldap_mail.to_sym].first,
|
||||||
|
agreement: true,
|
||||||
|
account_attributes: {
|
||||||
|
username: safe_username,
|
||||||
|
},
|
||||||
|
external: true,
|
||||||
|
confirmed_at: Time.now.utc
|
||||||
|
)
|
||||||
resource.save!
|
resource.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ module User::PamAuthenticable
|
||||||
|
|
||||||
self.email = "#{account.username}@#{find_pam_suffix}" if email.nil? && find_pam_suffix
|
self.email = "#{account.username}@#{find_pam_suffix}" if email.nil? && find_pam_suffix
|
||||||
self.confirmed_at = Time.now.utc
|
self.confirmed_at = Time.now.utc
|
||||||
self.admin = false
|
|
||||||
self.account = account
|
self.account = account
|
||||||
self.external = true
|
self.external = true
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,8 @@ class User < ApplicationRecord
|
||||||
last_sign_in_ip
|
last_sign_in_ip
|
||||||
skip_sign_in_token
|
skip_sign_in_token
|
||||||
filtered_languages
|
filtered_languages
|
||||||
|
admin
|
||||||
|
moderator
|
||||||
)
|
)
|
||||||
|
|
||||||
include LanguagesHelper
|
include LanguagesHelper
|
||||||
|
|
Loading…
Reference in a new issue