<commit_before>var settingsApp = angular.module('fbeaztAdmin')

settingsApp.controller('settingsController', function ($scope, $http) {
    $scope.model = {
        'delivery_disabled': false,
        'delivery_hours': '',
        'disable_app_versions': '',
        'delivery_disabled_reason': ''
    }
    $scope.error_msg = ''
    $scope.success_msg = ''
    $scope.load = function () {
        $http.get('/api/settings').success(function (data) {
            if (data.disable_app_versions && data.disable_app_versions instanceof Array) {
                data.disable_app_versions = data.disable_app_versions.join(",")
            }
            $scope.model = data;
        }).error(function (data) {
            if (data && data.status == "error" && data.message) {
                $scope.error_msg = data.message
            } else {
                $scope.error_msg = 'Oops! Got some error while trying to fetch settings!'
            }
        })
    }

    $scope.save = function () {
        $scope.error_msg = ''
        $scope.success_msg = ''
        var item = angular.copy($scope.model)
        item.disable_app_versions = item.disable_app_versions.split(',')
        $http.post('/api/settings', item).success(function () {
            $scope.success_msg = 'Settings saved successfully!'
            $scope.load()
        }).error(function (data, status) {
            if (data && data.status == "error" && data.message) {
                $scope.error_msg = data.message
            } else {
                $scope.error_msg = 'Oops! Got some error while trying to save settings!'
            }
        })
    }

    $scope.load()
})
<commit_msg>try fix the settings page<commit_after>var settingsApp = angular.module('fbeaztAdmin')

settingsApp.controller('settingsController', function ($scope, $http) {
    $scope.model = {
        'delivery_disabled': false,
        'delivery_hours': '',
        'disable_app_versions': '',
        'delivery_disabled_reason': ''
    }
    $scope.error_msg = ''
    $scope.success_msg = ''
    $scope.load = function () {
        $http.get('/api/settings').success(function (data) {
            if (data == null) {
                data = $scope.model
            }
            if (data.disable_app_versions && data.disable_app_versions instanceof Array) {
                data.disable_app_versions = data.disable_app_versions.join(",")
            }
            $scope.model = data;
        }).error(function (data) {
            if (data && data.status == "error" && data.message) {
                $scope.error_msg = data.message
            } else {
                $scope.error_msg = 'Oops! Got some error while trying to fetch settings!'
            }
        })
    }

    $scope.save = function () {
        $scope.error_msg = ''
        $scope.success_msg = ''
        var item = angular.copy($scope.model)
        item.disable_app_versions = item.disable_app_versions.split(',')
        $http.post('/api/settings', item).success(function () {
            $scope.success_msg = 'Settings saved successfully!'
            $scope.load()
        }).error(function (data, status) {
            if (data && data.status == "error" && data.message) {
                $scope.error_msg = data.message
            } else {
                $scope.error_msg = 'Oops! Got some error while trying to save settings!'
            }
        })
    }

    $scope.load()
})

{'fraction_non_alphanumeric': 0.13854715875805507, 'fraction_numerical': 0.0, 'mean_word_length': 1.9567099567099566, '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': '7644945', 'n_tokens_mistral': 972, 'n_tokens_neox': 958, 'n_words': 181}