Fix set preview for if artifact body is remote uri (#239)

Co-authored-by: cksac <cksac@gmail.com>
This commit is contained in:
cksac 2020-11-12 19:06:45 +08:00 committed by GitHub
parent 95ba6bab78
commit 45af97b258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -462,6 +462,8 @@ class Artifacts(object):
uri = artifact_object
artifact_type = 'custom'
artifact_type_data.content_type = mimetypes.guess_type(artifact_object)[0]
if preview:
artifact_type_data.preview = preview
elif isinstance(artifact_object, six.string_types):
# if we got here, we should store it as text file.
artifact_type = 'string'