changes as suggested by @dianakhuang and @jbau

@chrisndodge Kindly review the changeset.

Thanks
Returning a `success` boolean is not the right way to determine if the AJAX request was successful: that's what [HTTP status codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) are for. In your Python code, rather than doing this:
```python
if coupon.is_active:
    context = {
        'coupon_code': coupon.code,
        'coupon_description': coupon.description,
        'coupon_course_id': coupon.course_id.to_deprecated_string(),
        'coupon_discount': coupon.percentage_discount,
        'success': True,
        'message': 'coupon with the coupon id ({coupon_id}) updated successfully'.format(coupon_id=coupon_id)
    }
else:
    context = {
        'success': False,
        'message': _("coupon with the coupon id ({coupon_id}) is already inactive".format(coupon_id=coupon_id))
    }
return JsonResponse(context)
```
You should do this instead:
```python
if not coupon.is_active:
    return JsonReponse({
        'message': _("coupon with the coupon id ({coupon_id}) is already inactive".format(coupon_id=coupon_id))
    }, status=400)  # status code 400: Bad Request

return JsonResponse({
    'coupon_code': coupon.code,
    'coupon_description': coupon.description,
    'coupon_course_id': coupon.course_id.to_deprecated_string(),
    'coupon_discount': coupon.percentage_discount,
    'message': 'coupon with the coupon id ({coupon_id}) updated successfully'.format(coupon_id=coupon_id)
})  # status code 200: OK by default
```

Then, in your Javascript, you can do this:
```js
$.ajax({
  type: "POST",
  data: {id: coupon_id},
  url: "${section_data['ajax_get_coupon_info']}",
  success: function (data) {
    $('#coupon-error').val('');
    $('#coupon-error').attr('style', 'display: none');
    $('input#edit_coupon_code').val(data.coupon_code);
    $('input#edit_coupon_discount').val(data.coupon_discount);
    $('textarea#edit_coupon_description').val(data.coupon_description);
    $('input#edit_coupon_course_id').val(data.coupon_course_id);
    $('#edit-modal-trigger').click();
  },
  error: function(jqXHR, textStatus, errorThrown) {
    var data = $.parseJSON(jqXHR.responseText);
    $('#coupon-error').html(data.message).show();
  }
});
```
jQuery will know whether to call the `success` callback or the `error` callback based on the HTTP status code of the response.