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

Resending invites #438

Merged
merged 12 commits into from
Jan 7, 2025
Merged

Resending invites #438

merged 12 commits into from
Jan 7, 2025

Conversation

hemant10yadav
Copy link
Contributor

@hemant10yadav hemant10yadav commented Nov 20, 2024

@hemant10yadav hemant10yadav marked this pull request as draft November 20, 2024 13:06
@hemant10yadav hemant10yadav self-assigned this Nov 20, 2024
@hemant10yadav hemant10yadav marked this pull request as ready for review November 29, 2024 04:45
@calellowitz
Copy link
Collaborator

Test failure looks like a real migration issue

@@ -115,6 +119,7 @@ def invite_user(user_id, opportunity_access_id):
opportunity_access=opportunity_access,
defaults={
"message_sid": sms_status.sid,
"notification_date": now() if sms_status.sid else None,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the SID is not present, then the SMS is not sent, right? And if the SMS is not sent, we do not set the timestamp, so the user can trigger it again before 24 hours. Otherwise, if we set it to now() every time, the user won't be able to send the SMS again before 24 hours, even though the SMS was not sent earlier.

Copy link
Contributor

Choose a reason for hiding this comment

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

The SID will be present for all messages, even when no message was sent. The only case where the SID might not be present is when Twilio fails to register the SMS. A better way to set this notification_date would be in the SMSStatusCallbackView when Twilio responds with a "Delivered" status response.

Copy link
Contributor Author

@hemant10yadav hemant10yadav Jan 7, 2025

Choose a reason for hiding this comment

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

Thanks changed 65235ea

@@ -568,4 +570,23 @@ <h1 class="modal-title fs-5 text-white">{% translate "Import Catchment Areas" %}
</div>
</div>

<div class="modal fade" id="resendInviteModal" tabindex="-1" aria-labelledby="resendInviteModalLabel" aria-hidden="true">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change the current modal implementation to bootstrap alerts to show any responses returned from the server? This will keep the UX similar across the website.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am happy to do that. I assume it would be shown at the top level, but the problem is that when the user scrolls down, they won't see the alert unless they manually scroll back up to the top, or we trigger the scroll.

@calellowitz
Copy link
Collaborator

Pawan's comments seem right and I would encourage you to follow them, but nothing blocking on my end.

@hemant10yadav hemant10yadav merged commit 8c98c47 into main Jan 7, 2025
5 checks passed
@hemant10yadav hemant10yadav deleted the hy/resend-invite branch January 7, 2025 08:21
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.

3 participants