Fixed 500 error when sending unaccepted assets reminder #11700
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In the Unaccepted Assets report, users can resend reminders to users that haven't accepted or declined assets that require acceptance.
But to get some of the data needed in the notification, we associate the
action_logs
table with thecheckout_acceptances
using the columncreated_at
in both tables. This is because an asset can have "n" registers in theaction_logs
and we want to only link the one that's created when the asset got checked out. The problem is that I found data on thecheckout_acceptances
table with a null value in thecreated_at
column, so it can't get associate with the correspondent action log, and when the system needs that data to create the notifications it fails with an error 500.This PR return with an error if that column have a null value instead of fail, but maybe there' s a better way to handle this, since the data that it needs doesn´t look that important, let me know what you think.
Fixes freshdesk 30231
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: