1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Merge pull request #6755 from mabashian/1982-fix-smart-float-validation

fixed smart float validation when float field is not required
This commit is contained in:
Michael Abashian 2017-06-28 17:42:01 -04:00 committed by GitHub
commit 6dd507a8fc

View File

@ -355,7 +355,7 @@ function(ConfigurationUtils, i18n, $rootScope) {
require: 'ngModel',
link: function(scope, elm, attrs, ctrl) {
ctrl.$parsers.unshift(function(viewValue) {
if (FLOAT_REGEXP.test(viewValue)) {
if (viewValue === '' || FLOAT_REGEXP.test(viewValue)) {
ctrl.$setValidity('float', true);
return parseFloat(viewValue.replace(',', '.'));
} else {