-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: various fixes #738
fix: various fixes #738
Conversation
apollo/submissions/services.py
Outdated
sorted(submission.participant.phone_contacts, key=lambda p: p.updated, reverse=True)[0].number # noqa | ||
if submission.participant and | ||
submission.participant.phone_contacts else '', | ||
submission.last_phone_number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should store safe values if the submission does not have a value for last_phone_number
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the property defaults to None
, which is output as an empty string
apollo/submissions/services.py
Outdated
sib.participant.phone_contacts[0].number | ||
if sib.participant and sib.participant.phone_contacts | ||
else '', | ||
sib.last_phone_number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set a safe value in case a value for last_phone_number
is not available.
this pull request attempts to address: - nditech/apollo-issues#89, where the "recent phone" was inaccurate - nditech/apollo-issues#90, where the "db phone" and "recent phone" were to be updated - nditech/apollo-issues#91, where a specific order for participant phone numbers was to be set - nditech/apollo-issues#92, where the "db phone" and "recent phone" for location submission export was to match the observer export
8d42cef
to
4a5b150
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
this pull request attempts to address: