From e6106cb3346320e9147210fb915ea7933db6e0f3 Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Tue, 21 Sep 2021 22:16:48 +0530 Subject: [PATCH] invites: Update error message when max limit for the day is reached. This commit updates the error message returned when the maximum invite limit for the day. We update the error returned by API to only mention that the limit is reached and add the suggestion to use multi-use link or contact support in the message shown in webapp. --- static/js/invite.js | 1 + static/templates/invitation_failed_error.hbs | 7 +++++++ zerver/lib/actions.py | 20 ++++++++++++++------ zerver/lib/exceptions.py | 9 ++++++++- zerver/tests/test_signup.py | 6 ++---- 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/static/js/invite.js b/static/js/invite.js index ab3a613e0d..a6c7dbf3c9 100644 --- a/static/js/invite.js +++ b/static/js/invite.js @@ -109,6 +109,7 @@ function submit_invitation_form() { is_invitee_deactivated, license_limit_reached: arr.license_limit_reached, has_billing_access: page_params.is_owner || page_params.is_billing_admin, + daily_limit_reached: arr.daily_limit_reached, }); ui_report.message(error_response, invite_status, "alert-warning"); invitee_emails_group.addClass("warning"); diff --git a/static/templates/invitation_failed_error.hbs b/static/templates/invitation_failed_error.hbs index 126c53a6a1..1df7eba4b9 100644 --- a/static/templates/invitation_failed_error.hbs +++ b/static/templates/invitation_failed_error.hbs @@ -1,4 +1,11 @@

{{ error_message }}

+{{#if daily_limit_reached}} + {{#tr}} + Please contact support for an exception or add users with a reusable invite link. + {{#*inline "z-link-support"}}{{> @partial-block}}{{/inline}} + {{#*inline "z-link-invite-help"}}{{> @partial-block}}{{/inline}} + {{/tr}} +{{/if}}