Skip to content

Commit

Permalink
Merge pull request #30 from barslmn/release
Browse files Browse the repository at this point in the history
fix idat upload to start run
  • Loading branch information
yserdem authored Feb 22, 2025
2 parents 7fa710a + 9821c14 commit 294252f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions canvas/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def get_version():
except FileNotFoundError:
return "no version"


def start_run(chip_id):
if not settings.DEBUG:
HOST_IP = get_default_gateway_linux()
Expand All @@ -104,9 +105,12 @@ def start_run(chip_id):
with tempfile.NamedTemporaryFile(delete_on_close=False, mode="w") as ss:
ss.write(f"sample_id\tprotocol_id\tinstitution\n")
for cs in ChipSample.objects.filter(chip__chip_id=chip_id):
ss.write(
f"{chip_id}_{cs.position}\t{cs.sample.protocol_id}\t{cs.sample.institution.name}\n"
)
if cs.sample:
ss.write(
f"{chip_id}_{cs.position}\t{cs.sample.protocol_id}\t{cs.sample.institution.name}\n"
)
else:
ss.write(f"{chip_id}_{cs.position}\t{cs.position}\tnoInstitute\n")
ss.flush()
subprocess.run(
f"scp {ss.name} canvas@{HOST_IP}:/tmp",
Expand Down

0 comments on commit 294252f

Please sign in to comment.