Skip to content

Commit ff5c98a

Browse files
committed
Merge branch 'dev' of https://github.com/biocore/qiita into dev
2 parents 0d51557 + da6ab4b commit ff5c98a

File tree

12 files changed

+2236
-2594
lines changed

12 files changed

+2236
-2594
lines changed

qiita_db/processing_job.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,9 @@ def _update_and_launch_children(self, mapping):
16361636
# Submit all the children that already have all the input parameters
16371637
for c in ready:
16381638
c.submit()
1639+
# some jobs create several children jobs/validators and this can
1640+
# clog the submission process; giving it a second to avoid this
1641+
sleep(1)
16391642

16401643
@property
16411644
def outputs(self):

qiita_db/study.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Study(qdb.base.QiitaObject):
5757
title
5858
owner
5959
specimen_id_column
60+
autoloaded
6061
6162
Methods
6263
-------
@@ -77,7 +78,8 @@ class Study(qdb.base.QiitaObject):
7778
_table = "study"
7879
_portal_table = "study_portal"
7980
# The following columns are considered not part of the study info
80-
_non_info = frozenset(["email", "study_title", "ebi_study_accession"])
81+
_non_info = frozenset(["email", "study_title", "ebi_study_accession",
82+
"autoloaded"])
8183

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

483485
# --- Attributes ---
486+
@property
487+
def autoloaded(self):
488+
"""Returns if the study was autoloaded
489+
490+
Returns
491+
-------
492+
bool
493+
If the study was autoloaded or not
494+
"""
495+
with qdb.sql_connection.TRN:
496+
sql = """SELECT autoloaded FROM qiita.{0}
497+
WHERE study_id = %s""".format(self._table)
498+
qdb.sql_connection.TRN.add(sql, [self._id])
499+
return qdb.sql_connection.TRN.execute_fetchlast()
500+
501+
@autoloaded.setter
502+
def autoloaded(self, value):
503+
"""Sets the autoloaded status of the study
504+
505+
Parameters
506+
----------
507+
value : bool
508+
Whether the study was autoloaded
509+
"""
510+
sql = """UPDATE qiita.{0} SET autoloaded = %s
511+
WHERE study_id = %s""".format(self._table)
512+
qdb.sql_connection.perform_as_transaction(sql, [value, self._id])
513+
484514
@property
485515
def title(self):
486516
"""Returns the title of the study

qiita_db/support_files/patches/80.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Nov 10, 2020
2+
-- Add a flag to the studies to see if the study was submitted by Qiita or downloaded by EBI
3+
4+
ALTER TABLE qiita.study ADD autoloaded BOOL NOT NULL DEFAULT false;

0 commit comments

Comments
 (0)