Skip to content

Commit

Permalink
[webui] Prevent {} string in image fields
Browse files Browse the repository at this point in the history
- When importing a kiwi image to the database, this change will prevent
filling the database with the string '{}' in these fields.

Pair programmed with @mdeniz.
  • Loading branch information
eduardoj committed Nov 9, 2017
1 parent a7ccae1 commit f4c1dd7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/api/app/models/kiwi/image/xml_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ def description

return if attributes.blank?

description_type = attributes['type'].blank? ? '' : attributes['type']
author = attributes['author'].blank? ? '' : attributes['author']
contact = attributes['contact'].blank? ? '' : attributes['contact']
specification = attributes['specification'].blank? ? '' : attributes['specification']
Kiwi::Description.new(
description_type: attributes['type'],
author: attributes['author'],
contact: attributes['contact'],
specification: attributes['specification']
description_type: description_type,
author: author,
contact: contact,
specification: specification
)
end

Expand Down

0 comments on commit f4c1dd7

Please sign in to comment.