When i click on the same radio check twice, it changes the output to the opposite, but doesnt change the check

I've got 2 radio checks in a questionaire. If i choose Yes, it will show me certain inputs, and when check set to No it shows me different inputs. The thing is, when i click on Yes twice, check remains on the Yes, but shows me the inputs for 'no'. Do you have any idea why is it like that?

This one should show me 'yes' inputs This should show me 'no' inputs

Django html:

        <div class="form-check mt-5">
            <h6 class="c-grey-900">Czy masz swoje zwierzę?</h6>
            <label class="form-check-label mt-2" id="choose-if-animal">
                <input class="form-check-input" type="radio" name="has_animal" id="has_animal1" value="yes" > Tak, jestem właścicielem/właścicielką zwierzaka<br>
            </label>
        </div>
        <div class="form-check">
            <label class="form-check-label">
                <input class="form-check-input" type="radio" name="has_animal" id="has_animal2" value="no"> Nie, nie mam swojego zwierzęcia
            </label>
        </div>

In views.py its simple:

        if has_animal == 'yes':
            has_how_many_animals = all_post_data['has_how_many_animals']

        elif has_animal == 'no':
            animal_type_like = all_post_data.getlist('animal_type_like[]')
Back to Top