@@ -369,7 +369,7 @@ def exists_table(table):
369369 """
370370 with qdb .sql_connection .TRN :
371371 sql = """SELECT exists(
372- SELECT * FROM information_schema.tables
372+ SELECT table_name FROM information_schema.tables
373373 WHERE table_name=%s)"""
374374 qdb .sql_connection .TRN .add (sql , [table ])
375375 return qdb .sql_connection .TRN .execute_fetchlast ()
@@ -1464,6 +1464,10 @@ def generate_study_list(user, visibility):
14641464 (SELECT COUNT(sample_id) FROM qiita.study_sample
14651465 WHERE study_id=qiita.study.study_id)
14661466 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,
14671471 (SELECT array_agg(row_to_json((prep_template_id, data_type,
14681472 artifact_id, artifact_type, deprecated,
14691473 qiita.bioms_from_preparation_artifacts(prep_template_id)),
@@ -1558,6 +1562,10 @@ def generate_study_list(user, visibility):
15581562 del info ["shared_with_name" ]
15591563 del info ["shared_with_email" ]
15601564
1565+ # add extra info about sample information file
1566+ has_sample_info = info ['has_sample_info' ]
1567+ del info ['has_sample_info' ]
1568+
15611569 infolist .append (info )
15621570 return infolist
15631571
0 commit comments