Skip to content

[Contractors] Normalize payee emails and downcase existing ones - #14507

Open
manuthecoder wants to merge 2 commits into
mainfrom
mxg-normalize-payee-emails-and-downcase-existing-ones
Open

[Contractors] Normalize payee emails and downcase existing ones#14507
manuthecoder wants to merge 2 commits into
mainfrom
mxg-normalize-payee-emails-and-downcase-existing-ones

Conversation

@manuthecoder

Copy link
Copy Markdown
Contributor

Closes #14502

@manuthecoder
manuthecoder requested a review from a team August 5, 2026 19:40
@manuthecoder
manuthecoder requested a review from garyhtou as a code owner August 5, 2026 19:40
Comment on lines +55 to +58
return true if user&.auditor?
return true if record.payee.legal_entity&.users&.include?(user)

user&.email.present? && user.email.casecmp?(record.payee.email.to_s)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return true if user&.auditor?
return true if record.payee.legal_entity&.users&.include?(user)
user&.email.present? && user.email.casecmp?(record.payee.email.to_s)
return false if user.nil?
return true if user.auditor?
return true if record.payee.legal_entity&.users&.include?(user)
user.email == record.payee.email

Instead of using casecmp, we should update production data to downcase all existing emails.

It looks like in all cases, the page should not be accessible in transparency mode (when user is nil). I added it as a guard clause at the very beginning to simplify the logic in this method.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a maintenance task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Contractors] Recipient emails are case sensitive

2 participants