<commit_before>{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia %}
{% block extrahead %}
{{block.super}}
<script type="text/javascript">
$(function() {
    //Set the position numbers for the ballots to be ascending order
    var num_ballots = $("#id_ballots-TOTAL_FORMS").val()
    for(i = 0; i < num_ballots; i++) {
        $("#id_ballots-"+i+"-position_number").val(i+1);
    }
})
</script><commit_msg>Fix so that ballot JS only runs when adding an election.<commit_after>{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia %}
{% block extrahead %}
{{block.super}}
{% if add %}
<script type="text/javascript">
$(function() {
    //Set the position numbers for the ballots to be ascending order
    var num_ballots = $("#id_ballots-TOTAL_FORMS").val()
    for(i = 0; i < num_ballots; i++) {
        $("#id_ballots-"+i+"-position_number").val(i+1);
    }
})
</script>
{% endif %}
{'fraction_non_alphanumeric': 0.1817204301075269, 'fraction_numerical': 0.008602150537634409, 'mean_word_length': 4.143646408839779, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4935584', 'n_tokens_mistral': 333, 'n_tokens_neox': 308, 'n_words': 80}