From 2a4b9ced3aa15885b12c3ee5ad93570d7a279520 Mon Sep 17 00:00:00 2001 From: hemant10yadav Date: Fri, 29 Nov 2024 09:27:24 +0530 Subject: [PATCH] open model only when request is successfull --- commcare_connect/opportunity/tables.py | 13 ++++++++----- commcare_connect/static/js/project.js | 12 +++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/commcare_connect/opportunity/tables.py b/commcare_connect/opportunity/tables.py index af270325..4c5a71e9 100644 --- a/commcare_connect/opportunity/tables.py +++ b/commcare_connect/opportunity/tables.py @@ -190,11 +190,14 @@ def render_view_profile(self, record): return format_html( ( """
- - + +
""" ), resend_invite_url, diff --git a/commcare_connect/static/js/project.js b/commcare_connect/static/js/project.js index 05b31f49..806b4c12 100644 --- a/commcare_connect/static/js/project.js +++ b/commcare_connect/static/js/project.js @@ -16,11 +16,13 @@ function refreshTooltips() { window.refreshTooltips = refreshTooltips; function handleResendInviteResponse(event) { - const response = event.detail.elt; - const resendModal = new bootstrap.Modal( - document.getElementById('resendInviteModal'), - ); - resendModal.show(); + if (event.detail.successful) { + const response = event.detail.elt; + const resendModal = new bootstrap.Modal( + document.getElementById('resendInviteModal'), + ); + resendModal.show(); + } } window.handleResendInviteResponse = handleResendInviteResponse;