fix
This commit is contained in:
parent
c019766df2
commit
01f99a2f12
|
@ -81,6 +81,12 @@ class Organization < Owner
|
||||||
|
|
||||||
scope :with_visibility, ->(visibility) { joins(:organization_extension).where(organization_extensions: {visibility: visibility}) if visibility.present? }
|
scope :with_visibility, ->(visibility) { joins(:organization_extension).where(organization_extensions: {visibility: visibility}) if visibility.present? }
|
||||||
|
|
||||||
|
after_save :reset_cache_data
|
||||||
|
|
||||||
|
def reset_cache_data
|
||||||
|
Cache::V2::OwnerCommonService.new(self.login, self.mail).reset
|
||||||
|
end
|
||||||
|
|
||||||
def self.build(name, nickname, gitea_token=nil)
|
def self.build(name, nickname, gitea_token=nil)
|
||||||
self.create!(login: name, nickname: nickname, gitea_token: gitea_token)
|
self.create!(login: name, nickname: nickname, gitea_token: gitea_token)
|
||||||
end
|
end
|
||||||
|
|
|
@ -188,7 +188,8 @@ class User < Owner
|
||||||
:show_email, :show_location, :show_department,
|
:show_email, :show_location, :show_department,
|
||||||
:technical_title, :province, :city, :custom_department, to: :user_extension, allow_nil: true
|
:technical_title, :province, :city, :custom_department, to: :user_extension, allow_nil: true
|
||||||
|
|
||||||
before_save :update_hashed_password, :set_lastname, :reset_cache_data
|
before_save :update_hashed_password, :set_lastname
|
||||||
|
after_save :reset_cache_data
|
||||||
after_create do
|
after_create do
|
||||||
SyncTrustieJob.perform_later("user", 1) if allow_sync_to_trustie?
|
SyncTrustieJob.perform_later("user", 1) if allow_sync_to_trustie?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue