Skip to content

Commit

Permalink
Merge pull request #1081 from PlanoramaEvents/plan-999-fix-reg-sync
Browse files Browse the repository at this point in the history
PLAN-999 Update reg datum on person sync
  • Loading branch information
Gailbear authored Jun 22, 2024
2 parents 2b41d94 + bf8ec34 commit 336b31f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/controllers/people_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,28 @@ def clyde_sync

IdentityService.update_reg_info(person: person, details: details['data'])

# Also need to update the datum
update_datum(details['data'])

render_object(person)
end
end

def update_datum(data)
datum = RegistrationSyncDatum.find_by reg_id: data['id']
if datum
datum.update(
name: data['full_name']&.strip,
email: data['email']&.strip,
registration_number: data['ticket_number']&.strip,
preferred_name: data['preferred_name']&.strip,
alternative_email: data['alternative_email']&.strip,
badge_name: data['badge']&.strip,
raw_info: data
)
end
end

def unlink_registration
authorize current_person, policy_class: policy_class

Expand Down

0 comments on commit 336b31f

Please sign in to comment.