Skip to content
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

Verification: elegant methods for callouts #26

Merged
merged 12 commits into from
Apr 30, 2024
Merged

Verification: elegant methods for callouts #26

merged 12 commits into from
Apr 30, 2024

Conversation

650elx
Copy link
Collaborator

@650elx 650elx commented Apr 15, 2024

No description provided.

@650elx 650elx marked this pull request as ready for review April 23, 2024 11:13
asein-sinch
asein-sinch previously approved these changes Apr 23, 2024
sinch/domains/verification/models/responses.py Outdated Show resolved Hide resolved
method=response.body.get("method"),
_links=response.body.get("_links"),
sms=SMSResponse(
interception_timeout=response.body["sms"].get("interceptionTimeout"),

Choose a reason for hiding this comment

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

We can expect the server to always return this field, but it's noted as optional in the specification. Wouldn't it be safer to check for the existence of the sms property before reading sub-properties?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've added some additional logic.

sinch/domains/verification/models/__init__.py Outdated Show resolved Hide resolved
@650elx 650elx requested a review from asein-sinch April 29, 2024 16:24
@650elx 650elx merged commit b45a4f3 into main Apr 30, 2024
4 checks passed
@650elx 650elx deleted the DEVEXP-325 branch August 22, 2024 14:58
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.

2 participants