Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,9 @@ def _update_and_launch_children(self, mapping):
# Submit all the children that already have all the input parameters
for c in ready:
c.submit()
# some jobs create several children jobs/validators and this can
# clog the submission process; giving it a second to avoid this
sleep(1)

@property
def outputs(self):
Expand Down
32 changes: 31 additions & 1 deletion qiita_db/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Study(qdb.base.QiitaObject):
title
owner
specimen_id_column
autoloaded

Methods
-------
Expand All @@ -77,7 +78,8 @@ class Study(qdb.base.QiitaObject):
_table = "study"
_portal_table = "study_portal"
# The following columns are considered not part of the study info
_non_info = frozenset(["email", "study_title", "ebi_study_accession"])
_non_info = frozenset(["email", "study_title", "ebi_study_accession",
"autoloaded"])

def _lock_non_sandbox(self):
"""Raises QiitaDBStatusError if study is non-sandboxed"""
Expand Down Expand Up @@ -481,6 +483,34 @@ def insert_tags(cls, user, tags):
qdb.sql_connection.TRN.execute()

# --- Attributes ---
@property
def autoloaded(self):
"""Returns if the study was autoloaded

Returns
-------
bool
If the study was loaded or not
"""
with qdb.sql_connection.TRN:
sql = """SELECT autoloaded FROM qiita.{0}
WHERE study_id = %s""".format(self._table)
qdb.sql_connection.TRN.add(sql, [self._id])
return qdb.sql_connection.TRN.execute_fetchlast()

@autoloaded.setter
def autoloaded(self, value):
"""Sets the title of the study

Parameters
----------
value : bool
Value to set the autoloaded of this study
"""
sql = """UPDATE qiita.{0} SET autoloaded = %s
WHERE study_id = %s""".format(self._table)
qdb.sql_connection.perform_as_transaction(sql, [value, self._id])

@property
def title(self):
"""Returns the title of the study
Expand Down
4 changes: 4 additions & 0 deletions qiita_db/support_files/patches/80.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Nov 10, 2020
-- Add a flag to the studies to see if the study was submitted by Qiita or downloaded by EBI

ALTER TABLE qiita.study ADD autoloaded BOOL NOT NULL DEFAULT false;
Loading