Q:

Django 2 form is_valid is not working even on valid form data

I'm working on a very simple form to post data in Django(2) but always getting the form as invalid because the form.is_valid() not getting called.
Here's what I have so far:
From models.py:
class UserGroup(models.Model):
    email = models.EmailField(primary_key=True)
    group = models.CharField(max_length=250, default='notingroup')

    def __str__(self):
        return self.group

From forms.py:
class UserGroupForm(forms.ModelForm):
    class Meta:
        model = UserGroup
        fields = ('group', 'email')

From views.py:
def group_name(request):
    error = ''
    if request.method == 'POST':
        print(request.POST['email'])
        group_form = UserGroupForm(request.POST)
        print(group_form)
        if group_form.is_valid():
            ug_obj = UserGroup()
            ug_obj.group = group_form.cleaned_data['group']
            ug_obj.email = group_form.cleaned_data['email']
            ug_obj.save()
            return JsonResponse({"message": 'Got it inside valid'})

        else:
            error = 'Something went wrong'
            print(error)

        return JsonResponse({"message": 'an error occurs!'})

From html template:
<form method="post" id="gitForm" action="javascript:call_my_form()">
                {% csrf_token %}
                <label>Groupname: </label>
                <input id="user_email" type="text" value="{{ user.email }}" hidden>
                <input id="input" type="text" class="">
                <input type="submit" value="Mehet" class="btn btn-primary">
       <div id="error" style="color:red"></div>
</form>

From javasctip function for Ajax:
function call_my_form() {
    $(document).on('submit', '#gitForm', function (e) {
        e.preventDefault();
        console.log($('#input').val());
        console.log($('#user_email').val());
        $.ajax({
            type: 'POST',
            url: '/groupname',
            data: {
                group: $('#input').val(),
                email: $('#user_email').val(),
                csrfmiddlewaretoken: $('input[name=csrfmiddlewaretoken]').val()
            },
            success: function (jsonResponse) {
                document.getElementById("demo").innerHTML = jsonResponse.message;

            }
        }).done(function (jsonResponse) {
            document.getElementById("demo").innerHTML = jsonResponse.message;
        })
    });
}

I'm getting the correct data into the view but still the form.is_valid() not get called, 
Here's the output:

**********@mail.com 
  <tr><th><label
  for="id_group">Group:</label></th><td><input type="text" name="group"
  value="scsacas" maxlength="250" required id="id_group"></td></tr>
  <tr><th><label for="id_email">Email:</label></th><td><ul
  class="errorlist"><li>User group with this Email already
  exists.</li></ul><input type="email" name="email"
  value="abdul12391@gmail.com" maxlength="254" required
  id="id_email"></td></tr> 
Something went wrong [18/Jul/2019 09:47:47]
  "POST /groupname HTTP/1.1" 200 31

A:

As it says in your output: User group with this Email already exists. 
So you're trying to submit an email that already exists. That's why your form.is_valid() isn't being called.

