Skip to content

Commit

Permalink
update sync_at for ad3\admin accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroldwong committed Oct 23, 2023
1 parent e35f158 commit 67a5754
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/dss_dw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ def self.perform_dw_request(path)
def self.create_or_update_using_dw(loginid)
Rails.logger.debug "Create/update '#{loginid}' from DW ..."

# update synced_at for ad3\admin-* accounts to maintain Active status
if loginid.include? "admin-"
dw_person = DssDw.fetch_person_by_loginid(loginid.sub(/^admin-/, ""))
return nil unless dw_person

p = Person.find_or_create_by(loginid: loginid)
p.synced_at = dw_person['person']['lastSeen'] || p.synced_at
p.save!

return p
end

dw_person = DssDw.fetch_person_by_loginid(loginid)

return nil unless dw_person
Expand Down

0 comments on commit 67a5754

Please sign in to comment.