Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 4c5d0d33 authored by Mikaël Salson's avatar Mikaël Salson Committed by marc duez
Browse files

sample_set.py: Remove files only if they belong to a single sample set

parent 999344d5
......@@ -1023,18 +1023,26 @@ def delete():
log.error(res)
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
sequence_file_id_sample_sets = {}
#delete data file
query = db( (db.sample_set_membership.sample_set_id == sample_set.id)
& (db.sequence_file.id == db.sample_set_membership.sequence_file_id)
).select(db.sequence_file.id)
for row in query :
db(db.results_file.sequence_file_id == row.id).delete()
sample_sets = get_sequence_file_sample_sets(row.id)
sequence_file_id_sample_sets[row.id] = sample_sets
if len(sample_sets) == 1:
db(db.results_file.sequence_file_id == row.id).delete()
#delete sequence file
query = db((db.sequence_file.id == db.sample_set_membership.sequence_file_id)
& (db.sample_set_membership.sample_set_id == sample_set.id)
).select(db.sequence_file.id)
for row in query :
if not row.id in sequence_file_id_sample_sets:
sample_sets = get_sequence_file_sample_sets(row.id)
sequence_file_id_sample_sets[row.id] = sample_sets
if len(sequence_file_id_sample_sets[row.id]) == 1:
db(db.sequence_file.id == row.id).delete()
#delete patient sample_set
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment