Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #3451 #3452

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion qiita_db/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,11 @@ def test_generate_analysis_list(self):
exp = [{'mapping_files': [
(16, qdb.util.get_filepath_information(16)['fullpath'])],
'description': 'A test analysis', 'artifacts': [8, 9], 'name':
'SomeAnalysis', 'analysis_id': 1, 'visibility': 'private'},
'SomeAnalysis', 'owner': 'test@foo.bar', 'analysis_id': 1,
'visibility': 'private'},
{'mapping_files': [], 'description': 'Another test analysis',
'artifacts': [], 'name': 'SomeSecondAnalysis',
'owner': 'admin@foo.bar',
'analysis_id': 2, 'visibility': 'private'}]
# removing timestamp for testing
for i in range(len(obs)):
Expand Down
7 changes: 4 additions & 3 deletions qiita_db/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,7 @@ def generate_analysis_list(analysis_ids, public_only=False):
return []

sql = """
SELECT analysis_id, a.name, a.description, a.timestamp,
SELECT analysis_id, a.name, a.description, a.timestamp, a.email,
array_agg(DISTINCT artifact_id),
array_agg(DISTINCT visibility),
array_agg(DISTINCT CASE WHEN filepath_type = 'plain_text'
Expand All @@ -2135,7 +2135,8 @@ def generate_analysis_list(analysis_ids, public_only=False):

qdb.sql_connection.TRN.add(sql, [tuple(analysis_ids)])
for row in qdb.sql_connection.TRN.execute_fetchindex():
aid, name, description, ts, artifacts, av, mapping_files = row
aid, name, description, ts, owner, artifacts, \
av, mapping_files = row

av = 'public' if set(av) == {'public'} else 'private'
if av != 'public' and public_only:
Expand All @@ -2156,7 +2157,7 @@ def generate_analysis_list(analysis_ids, public_only=False):
results.append({
'analysis_id': aid, 'name': name, 'description': description,
'timestamp': ts.strftime("%m/%d/%y %H:%M:%S"),
'visibility': av, 'artifacts': artifacts,
'visibility': av, 'artifacts': artifacts, 'owner': owner,
'mapping_files': mapping_files})

return results
Expand Down
1 change: 1 addition & 0 deletions qiita_pet/handlers/analysis_handlers/base_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def analysis_description_handler_get_request(analysis_id, user):
'analysis_is_public': analysis.is_public,
'analysis_description': analysis.description,
'analysis_mapping_id': analysis.mapping_file,
'analysis_owner': analysis.owner.email,
'alert_type': alert_type,
'artifacts': artifacts,
'analysis_reservation': analysis._slurm_reservation()[0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_analysis_description_handler_get_request(self):
'analysis_id': 1,
'analysis_description': 'A test analysis',
'analysis_mapping_id': 16,
'analysis_owner': 'test@foo.bar',
'analysis_is_public': False,
'alert_type': 'info',
'artifacts': {
Expand Down Expand Up @@ -67,6 +68,7 @@ def test_analysis_description_handler_get_request(self):
'analysis_id': 1,
'analysis_description': 'A test analysis',
'analysis_mapping_id': 16,
'analysis_owner': 'test@foo.bar',
'analysis_is_public': False,
'alert_type': 'info',
'artifacts': {
Expand Down Expand Up @@ -98,6 +100,7 @@ def test_analysis_description_handler_get_request(self):
'analysis_id': 1,
'analysis_description': 'A test analysis',
'analysis_mapping_id': 16,
'analysis_owner': 'test@foo.bar',
'analysis_is_public': False,
'alert_type': 'danger',
'artifacts': {
Expand Down
Loading
Loading