<commit_before>App.DonationController = Ember.ObjectController.extend(BB.ModalControllerMixin, App.ControllerValidationMixin, {

    requiredFields: ['amount' ],
    fieldsToWatch: ['amount' ],

    defaultAmounts: [50, 75, 100],

    init: function() {
        this._super();

        this.set('errorDefinitions', [
             {
                'property': 'amount',
                'validateProperty': 'validAmount',
                'message': gettext('C\'mon, don\'t be silly! Give them at least 5 euro'),
                'priority': 1
            },
        ]);
    },


    actions: {
        changeAmount: function(amount){
            this.set('amount', amount);
        },

        nextStep: function(){
            var _this = this,
                donation = this.get('model'),
                order = donation.get('order');

            // Enable the validation of errors on fields only after pressing the signup button
            _this.enableValidation();
<commit_msg>clean kommas when user fills in donation amount<commit_after>App.DonationController = Ember.ObjectController.extend(BB.ModalControllerMixin, App.ControllerValidationMixin, {

    requiredFields: ['amount' ],
    fieldsToWatch: ['amount' ],

    defaultAmounts: [50, 75, 100],

    init: function() {
        this._super();

        this.set('errorDefinitions', [
             {
                'property': 'amount',
                'validateProperty': 'validAmount',
                'message': gettext('C\'mon, don\'t be silly! Give them at least 5 euro'),
                'priority': 1
            },
        ]);
    },

    cleanKommas: function() {
        var amount = this.get('model.amount');
        if (amount.indexOf(",") != -1) {
            this.set('amount', amount.replace(",", "."));
        }
        return;

    },

    actions: {
        changeAmount: function(amount){
            this.set('amount', amount);
        },

        nextStep: function(){
            var _this = this,
                donation = this.get('model'),
                order = donation.get('order');

            _this.cleanKommas();

            // Enable the validation of errors on fields only after pressing the signup button
            _this.enableValidation();

{'fraction_non_alphanumeric': 0.13146167557932265, 'fraction_numerical': 0.008467023172905526, 'mean_word_length': 1.8745198463508324, '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': '2145201', 'n_tokens_mistral': 620, 'n_tokens_neox': 566, 'n_words': 139}