Commit a056a0e9 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

controllers/admin.py, views/admin/index.html: remove old 'sample_set_fixer()'

This code was used once when migrating the database to sample sets. See 11d4c64f and #2284.
This is now dangerous, nobody should click on that link.
parent 37bc7185
......@@ -156,36 +156,6 @@ def make_backup():
def load_backup():
if auth.is_admin():
db.import_from_csv_file(defs.DB_BACKUP_FILE,'rb')
## delete all sample_set
## create a new sample_set for every patient/ every sequence_file
## add sequence_file from a patient to the patient sample set
## Add sample_set_id to fused_file and analysis_file entries
def sample_set_fixer():
if auth.is_admin():
db(db.sample_set.id>0).update(sample_type="old")
db(db.sample_set_membership.id>0).delete()
for row in db(db.sequence_file.id>0).select() :
sample_set_id = db.sample_set.insert(sample_type="sequence_file") ### defs.SET_TYPE ?
db.sample_set_membership.insert(sample_set_id=sample_set_id,
sequence_file_id=row.id)
for row in db(db.patient.id>0).select() :
sample_set_id = db.sample_set.insert(sample_type=defs.SET_TYPE_PATIENT)
db.patient[row.id] = dict(sample_set_id=sample_set_id)
for row2 in db(db.sequence_file.patient_id==row.id).select() :
db.sample_set_membership.insert(sample_set_id=sample_set_id,
sequence_file_id=row2.id)
db(db.fused_file.patient_id==row.id).update(sample_set_id=sample_set_id)
db(db.analysis_file.patient_id==row.id).update(sample_set_id=sample_set_id)
db(db.sample_set.sample_type=="old").delete() ### defs.SET_TYPE ?
def repair():
if auth.is_admin():
......
......@@ -8,7 +8,6 @@
</br>Database maintenance:
<a class="button" href="/vidjil/appadmin/index">administration</a>
<a class="button" onclick="db.call('admin/repair_missing_files');">fix missing files</a>
<a class="button" onclick="db.call('admin/sample_set_fixer');">fix sample set</a>
<a class="button" onclick="db.call('admin/repair');">repair db</a>
<a class="button" onclick="db.call('admin/make_backup');">make backup</a>
......
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