<commit_before>ProjectFormController.$inject = ['$rootScope', '$state', '$stateParams',
    'projects', 'sections',
    'majors', 'toaster',
    'TbUtils', '$location'
];

function ProjectFormController($rootScope, $state, $stateParams,
    projects, sections,
    majors, toaster,
    TbUtils, $location) {
    if ($rootScope.Role !== 'Admin') $state.go('main.projects');

    var vm = this;

    vm.edit = $state.current.name.includes('edit');
    vm.formLegend = vm.edit ? "Editar Proyecto" : "Nuevo Proyecto";

    vm.sections = [];
    vm.majors = [];
    vm.project = setProject();

    vm.majorsLoading = true;
    vm.sectionsLoading = true;
    vm.submitting = false;

    vm.submitProject = submitProject;
    vm.checkboxListItemClicked = checkboxListItemClicked;
    vm.majorsAndStatusValid = majorsAndStatusValid;
    vm.toTitleCase = TbUtils.toTitleCase;

    var editId = vm.edit ? vm.project.Id : -1;

    majors.getMajors(getMajorsSuccess, getMajorsFail);
    sections.getSections(getSectionsSuccess, getSectionsFail);

    function setProject() {
        return $stateParams.project ?
            JSON.parse($stateParams.project) : {
                //ProjectId: '',
                Name: '',
                Description: '',
                //Cost: 0.0,
                MajorIds: [],
                //SectionIds: [0],
                BeneficiarieOrganization: ''
                //BeneficiarieGroups: '',
                //BeneficiariesQuantity: 0
            };
    }

    function submitProject() {
        vm.submitting = true;

        if (vm.edit) {
            removeProjectNonAPIProperties();
            updateProject();
        } else
            postNewProject();
    }

    function removeProjectNonAPIProperties() {
        delete vm.project.$$hashKey;<commit_msg>Uncomment sections<commit_after>ProjectFormController.$inject = ['$rootScope', '$state', '$stateParams',
    'projects', 'sections',
    'majors', 'toaster',
    'TbUtils', '$location'
];

function ProjectFormController($rootScope, $state, $stateParams,
    projects, sections,
    majors, toaster,
    TbUtils, $location) {
    if ($rootScope.Role !== 'Admin') $state.go('main.projects');

    var vm = this;

    vm.edit = $state.current.name.includes('edit');
    vm.formLegend = vm.edit ? "Editar Proyecto" : "Nuevo Proyecto";

    vm.sections = [];
    vm.majors = [];
    vm.project = setProject();

    vm.majorsLoading = true;
    vm.sectionsLoading = true;
    vm.submitting = false;

    vm.submitProject = submitProject;
    vm.checkboxListItemClicked = checkboxListItemClicked;
    vm.majorsAndStatusValid = majorsAndStatusValid;
    vm.toTitleCase = TbUtils.toTitleCase;

    var editId = vm.edit ? vm.project.Id : -1;

    majors.getMajors(getMajorsSuccess, getMajorsFail);
    sections.getSections(getSectionsSuccess, getSectionsFail);

    function setProject() {
        return $stateParams.project ?
            JSON.parse($stateParams.project) : {
                //ProjectId: '',
                Name: '',
                Description: '',
                //Cost: 0.0,
                MajorIds: [],
                SectionIds: [0],
                BeneficiarieOrganization: ''
                //BeneficiarieGroups: '',
                //BeneficiariesQuantity: 0
            };
    }

    function submitProject() {
        vm.submitting = true;

        if (vm.edit) {
            removeProjectNonAPIProperties();
            updateProject();
        } else
            postNewProject();
    }

    function removeProjectNonAPIProperties() {
        delete vm.project.$$hashKey;
{'fraction_non_alphanumeric': 0.13032581453634084, 'fraction_numerical': 0.00278473962684489, 'mean_word_length': 2.283363802559415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1462283', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1046, 'n_words': 186}