1
0
Fork 0

FIX: Minor bugfixes in manager and create_group action

Dieser Commit ist enthalten in:
angusmcleod 2021-09-07 11:11:29 +08:00
Ursprung 8ddff9873d
Commit 208cb1229a
2 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -48,20 +48,21 @@ class CustomWizard::AdminManagerController < CustomWizard::AdminController
imported = []
failures = []
templates = template_json.is_a?(Array) ? template_json : [template_json]
template_json.each do |json|
template = CustomWizard::Template.new(json)
templates.each do |raw_template|
template = CustomWizard::Template.new(raw_template)
template.save(skip_jobs: true, create: true)
if template.errors.any?
failures.push(
id: json['id'],
id: template.data['id'],
messages: template.errors.full_messages.join(', ')
)
else
imported.push(
id: json['id'],
name: json['name']
id: template.data['id'],
name: template.data['name']
)
end
end

Datei anzeigen

@ -225,7 +225,7 @@ class CustomWizard::Mapper
end
def interpolate(string, opts = { user: true, wizard: true, value: true, template: false })
return string if string.blank?
return string if string.blank? || string.frozen?
if opts[:user]
string.gsub!(/u\{(.*?)\}/) { |match| map_user_field($1) || '' }