code: def delete_genelist(list_id, case_id=None):
      
      if case_id:
          # unlink a case from a gene list
          case_obj = app.db.case(case_id)
          app.db.remove_genelist(list_id, case_obj=case_obj)
          return redirect(request.referrer)
      else:
          # remove the whole gene list
          app.db.remove_genelist(list_id)
          return redirect(url_for('.index'))
docs: Delete a whole gene list with links to cases or a link.