Skip to content

Commit 0067381

Browse files
committed
add base for new admin plugin
1 parent 6f7a247 commit 0067381

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

qiita_db/artifact.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def create(cls, filepaths, artifact_type, name=None, prep_template=None,
337337
raise qdb.exceptions.QiitaDBArtifactCreationError(
338338
"When provided, both parents and processing parameters should "
339339
"be provided")
340-
elif bool(analysis) != bool(data_type):
340+
elif bool(analysis) and not bool(data_type):
341341
# When provided, analysis and data_type both should be
342342
# provided (this is effectively doing an XOR)
343343
raise qdb.exceptions.QiitaDBArtifactCreationError(
@@ -476,7 +476,8 @@ def _associate_with_analysis(instance, analysis_id):
476476
instance = _common_creation_steps(
477477
artifact_type, None, data_type, None)
478478
# Associate the artifact with the analysis
479-
analysis.add_artifact(instance)
479+
if analysis is not None:
480+
analysis.add_artifact(instance)
480481

481482
# Associate the artifact with its filepaths
482483
fp_ids = qdb.util.insert_filepaths(

qiita_db/handlers/processing_job.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ def get(self, job_id):
7171
cmd = job.command.name
7272
params = job.parameters.values
7373
status = job.status
74+
msg = '' if status != 'error' else job.log.msg
7475

7576
response = {'command': cmd, 'parameters': params,
76-
'status': status}
77+
'status': status, 'msg': msg}
78+
7779
self.write(response)
7880

7981

qiita_db/processing_job.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,11 +1197,15 @@ def _complete_artifact_definition(self, artifact_data):
11971197
AND processing_job_id = %s"""
11981198
qdb.sql_connection.TRN.add(sql, [an.id, self.id])
11991199
data_type = qdb.sql_connection.TRN.execute_fetchlast()
1200-
else:
1200+
elif job_params['template'] is not None:
12011201
pt = qdb.metadata_template.prep_template.PrepTemplate(
12021202
job_params['template'])
12031203
an = None
12041204
data_type = None
1205+
else:
1206+
pt = None
1207+
an = None
1208+
data_type = 'job_output_folder'
12051209

12061210
qdb.artifact.Artifact.create(
12071211
filepaths, atype, prep_template=pt, analysis=an,

qiita_db/support_files/patches/83.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- August 16, 2021
2+
-- adding new artifact_type for raw_job_folder
3+
INSERT INTO qiita.data_type (data_type) VALUES ('job_output_folder');

0 commit comments

Comments
 (0)