Skip to content

Commit b5609bd

Browse files
Luke TuiteLuke Tuite
authored andcommitted
Added a button so users can access their LZ or Data directory through the portal. I may need functionality that determines if a submission has metadata V1 or V2 to have this work properly. I think Ivan has a table in the DB that specifies this
1 parent fd78dc8 commit b5609bd

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

ingest/templates/ingest/collection_detail.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ <h1><b>Submission Name</b> {{ collection.name }}
6767
<strong>This submission doesn't have any Metadata Version 1.</strong>
6868
</div>
6969
{% endif %}
70-
70+
<div><a href="{% url 'ingest:ondemandSubmission' collection.id %}">
71+
<button class="btn btn-lg btn-primary" value="ignore" formnovalidate="">View Submission Directory</button>
72+
</a></div>
7173
<p>
7274

7375
<table>

ingest/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@
5555
re_path(r'^change_bil_admin_privs/$', views.change_bil_admin_privs, name = 'change_bil_admin_privs'),
5656
path('add_project_user/<int:pk>', views.add_project_user, name = 'add_project_user'),
5757
path('people_of_pi', views.people_of_pi, name = 'people_of_pi'),
58-
re_path(r'^write_user_to_project_people/$', views.write_user_to_project_people, name = 'write_user_to_project_people')
58+
re_path(r'^write_user_to_project_people/$', views.write_user_to_project_people, name = 'write_user_to_project_people'),
59+
path('collection/ondemandSubmission/<int:pk>', views.ondemandSubmission, name = 'ondemandSubmission')
5960
]

ingest/views.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,20 @@ def collection_detail(request, pk):
934934
'descriptive_metadata_queryset': descriptive_metadata_queryset,
935935
'pi': pi, 'datasets_list':datasets_list})
936936

937+
@login_required
938+
def ondemandSubmission(request, pk):
939+
coll = Collection.objects.get(id = pk)
940+
if coll.submission_status == 'SUCCESS' and coll.validation_status == 'SUCCESS':
941+
sheet = Sheet.objects.filter(collection_id=coll.id).last()
942+
print(sheet)
943+
ds = Dataset.objects.filter(sheet = sheet.id).last()
944+
p = ds.bildirectory
945+
path = p[:33]
946+
else:
947+
path = coll.data_path
948+
od = 'https://ondemand.bil.psc.edu/pun/sys/dashboard/files/fs' + path
949+
return redirect(od)
950+
937951
class CollectionUpdate(LoginRequiredMixin, UpdateView):
938952
""" Edit an existing collection ."""
939953
model = Collection

out_empties.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
date/time is 20230221112151
2+
log name is private_tmp_docker_tmp2l49vxb7_stg154fec44-40c2-4c18-bbcf-410c960bb73d_a74405c7708bb4aa
3+
log name is private/tmp/docker_tmp2l49vxb7/stg154fec44-40c2-4c18-bbcf-410c960bb73d/a74405c7708bb4aa
4+
1557081 0 drwxr-xr-x 2 luketuite staff 64 Feb 20 13:47 .

0 commit comments

Comments
 (0)