mirror of
https://github.com/zulip/zulip.git
synced 2026-07-09 21:21:47 +08:00
referral: Prevent empty form submission
(imported from commit cc012e84c21bc424adaaa79611f09415480a2ba5)
This commit is contained in:
parent
16f2a6e284
commit
51beeba854
@ -54,6 +54,7 @@ exports.update_state = function (granted, used) {
|
||||
$(".no-more-invites").hide();
|
||||
} else {
|
||||
$(".still-have-invites").hide();
|
||||
$("#referral-form input").blur();
|
||||
if (ever_had_invites) {
|
||||
$(".no-more-invites").show();
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
<div class="still-have-invites">
|
||||
{# Many of these values are set by the initialization code in referral.js #}
|
||||
<form id="referral-form">
|
||||
<input class="input-block-level" type="email" name="email" />
|
||||
<input class="input-block-level required" type="email" name="email" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="invite-count-area">
|
||||
|
||||
@ -2223,6 +2223,8 @@ def json_get_bots(request, user_profile):
|
||||
@authenticated_json_post_view
|
||||
@has_request_variables
|
||||
def json_refer_friend(request, user_profile, email=REQ):
|
||||
if not email:
|
||||
return json_error("No email address specified")
|
||||
if user_profile.invites_granted - user_profile.invites_used <= 0:
|
||||
return json_error("Insufficient invites")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user