Merge pull request #6253 from AlanCoding/smart_error

Fix server error creating smart inventories

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-03-11 13:08:00 +00:00
committed by GitHub
2 changed files with 61 additions and 1 deletions

View File

@@ -1600,7 +1600,7 @@ class InventorySerializer(BaseSerializerWithVariables):
})
SmartFilter().query_from_string(host_filter)
except RuntimeError as e:
raise models.base.ValidationError(e)
raise models.base.ValidationError(str(e))
return host_filter
def validate(self, attrs):