@@ -369,7 +369,7 @@ def exists_table(table):
369
369
"""
370
370
with qdb .sql_connection .TRN :
371
371
sql = """SELECT exists(
372
- SELECT * FROM information_schema.tables
372
+ SELECT table_name FROM information_schema.tables
373
373
WHERE table_name=%s)"""
374
374
qdb .sql_connection .TRN .add (sql , [table ])
375
375
return qdb .sql_connection .TRN .execute_fetchlast ()
@@ -1464,6 +1464,10 @@ def generate_study_list(user, visibility):
1464
1464
(SELECT COUNT(sample_id) FROM qiita.study_sample
1465
1465
WHERE study_id=qiita.study.study_id)
1466
1466
AS number_samples_collected,
1467
+ (SELECT EXIST(
1468
+ SELECT 1 FROM qiita.study_sample
1469
+ WHERE study_id = qiita.study.study_id LIMIT 1))
1470
+ AS has_sample_info,
1467
1471
(SELECT array_agg(row_to_json((prep_template_id, data_type,
1468
1472
artifact_id, artifact_type, deprecated,
1469
1473
qiita.bioms_from_preparation_artifacts(prep_template_id)),
@@ -1558,6 +1562,10 @@ def generate_study_list(user, visibility):
1558
1562
del info ["shared_with_name" ]
1559
1563
del info ["shared_with_email" ]
1560
1564
1565
+ # add extra info about sample information file
1566
+ has_sample_info = info ['has_sample_info' ]
1567
+ del info ['has_sample_info' ]
1568
+
1561
1569
infolist .append (info )
1562
1570
return infolist
1563
1571
0 commit comments