Skip to content

Commit

Permalink
Fix order of calls (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskl authored Aug 21, 2024
1 parent 9d64a7f commit f7f0d49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/pfmp_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def retry_incomplete_payment_request!

def rectify_and_update_attributes!(confirmed_pfmp_params, confirmed_address_params)
ApplicationRecord.transaction do
@pfmp.rectify!
@pfmp.update!(confirmed_pfmp_params)
@pfmp.student.update!(confirmed_address_params)
@pfmp.rectify!
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/asp/entities/adresse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def self.from_payment_request(payment_request) # rubocop:disable Metrics/AbcSize
pointremise: payment_request.student.address_line1,
cpltdistribution: payment_request.student.address_line2,
codetypeadr: ASP::Mappers::PRINCIPAL_ADDRESS_TYPE,
codeinseepays: InseeCountryCodeMapper.call(student.address_country_code),
codeinseepays: InseeCountryCodeMapper.call(payment_request.student.address_country_code),
codecominsee: payment_request.student.address_city_insee_code,
codepostalcedex: payment_request.student.address_postal_code
)
Expand Down

0 comments on commit f7f0d49

Please sign in to comment.