<commit_before>define([
    'app',
    '../../scripts/services/getConfig'
], function(app) {
    'use strict';

    app.service('crudManager', ['$q', 'Restangular', 'getConfig', function($q, Restangular, getConfig) {

        /**
         * Get one entity
         *
         * @param {String} entityName  name of the entity
         * @param {Number} entityId       id of the entity
         *
         * @returns {promise} (list of fields (with their values if set) & the entity name, label & id-
         */
        function getOne(entityName, entityId) {
            var deferred = $q.defer(),
                entityConfig;

            getConfig()
                .then(function(config) {
                    if (!(entityName in config.entities)) {
                        return $q.reject('Entity ' + entityName + ' not found.');
                    }

                    entityConfig = config.entities[entityName];
                    Restangular.setBaseUrl(config.global.baseApiUrl);

                    // Get element data
                    return Restangular
                        .one(entityName, entityId)
                        .get();

                })
                .then(function(entity) {

                    var fields = entityConfig.fields;

                    angular.forEach(fields, function(field, fieldName) {
                        if(typeof(field.edition) === "undefined") {<commit_msg>Fix regression on edition form<commit_after>define([
    'app',
    '../../scripts/services/getConfig'
], function(app) {
    'use strict';

    app.service('crudManager', ['$q', 'Restangular', 'getConfig', function($q, Restangular, getConfig) {

        /**
         * Get one entity
         *
         * @param {String} entityName  name of the entity
         * @param {Number} entityId       id of the entity
         *
         * @returns {promise} (list of fields (with their values if set) & the entity name, label & id-
         */
        function getOne(entityName, entityId) {
            var deferred = $q.defer(),
                entityConfig;

            getConfig()
                .then(function(config) {
                    if (!(entityName in config.entities)) {
                        return $q.reject('Entity ' + entityName + ' not found.');
                    }

                    entityConfig = config.entities[entityName];
                    Restangular.setBaseUrl(config.global.baseApiUrl);
                    Restangular.setFullResponse(true);  // To get also the headers

                    // Get element data
                    return Restangular
                        .one(entityName, entityId)
                        .get();

                })
                .then(function(response) {

                    var fields = entityConfig.fields,
                        entity = response.data;

                    angular.forEach(fields, function(field, fieldName) {
                        if(typeof(field.edition) === "undefined") {
{'fraction_non_alphanumeric': 0.111, 'fraction_numerical': 0.0, 'mean_word_length': 1.3931419457735248, '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': '3933968', 'n_tokens_mistral': 754, 'n_tokens_neox': 708, 'n_words': 178}