Skip to content

Commit

Permalink
Can't duplicate election when editing date extra field (#295)
Browse files Browse the repository at this point in the history
Parent issue: sequentech/meta#70
  • Loading branch information
edulix committed Apr 27, 2023
1 parent a7ac64b commit c10a882
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion avUi/election-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ angular.module('avUi')
});

d.extra_fields = _.filter(el.census.extra_fields, function(ef) {
var must = ef.must;
delete ef.disabled;
delete ef.must;
delete ef.value;

// only add regex if it's filled and it's a text field
if (!angular.isUndefined(ef.regex) &&
Expand Down
3 changes: 1 addition & 2 deletions dist/appCommon-v7.3.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -1441,8 +1441,7 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist
return el.id && (d.id = el.id), d.admin_fields = _.filter(el.census.admin_fields, function(af) {
return !0;
}), d.extra_fields = _.filter(el.census.extra_fields, function(ef) {
ef.must;
return delete ef.disabled, delete ef.must, angular.isUndefined(ef.regex) || _.contains([ "int", "text" ], ef.type) && 0 !== $.trim(ef.regex).length || delete ef.regex,
return delete ef.disabled, delete ef.must, delete ef.value, angular.isUndefined(ef.regex) || _.contains([ "int", "text" ], ef.type) && 0 !== $.trim(ef.regex).length || delete ef.regex,
_.contains([ "bool", "captcha" ], ef.type) ? (delete ef.min, delete ef.max) : (ef.min && (ef.min = parseInt(ef.min)),
ef.max && (ef.max = parseInt(ef.max))), !0;
}), d;
Expand Down

0 comments on commit c10a882

Please sign in to comment.