Commit 7a653e92 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

controllers/file.py: make sure the seq_filename exists

parent 6f60e38f
...@@ -189,7 +189,8 @@ def delete_sequence_file(seq_id): ...@@ -189,7 +189,8 @@ def delete_sequence_file(seq_id):
sequence = db.sequence_file[seq_id] sequence = db.sequence_file[seq_id]
seq_filename = sequence.data_file seq_filename = sequence.data_file
if auth.can_modify_patient(sequence.patient_id): if auth.can_modify_patient(sequence.patient_id):
log.debug('Deleting '+defs.DIR_SEQUENCES+seq_filename+' with ID'+str(seq_id)) if seq_filename is not None:
log.debug('Deleting '+defs.DIR_SEQUENCES+seq_filename+' with ID'+str(seq_id))
db.sequence_file[seq_id] = dict(data_file = None) db.sequence_file[seq_id] = dict(data_file = None)
else: else:
return error_message('you need admin permission to delete this file') return error_message('you need admin permission to delete this file')
......
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