From 5892ffc7488b0c9cbb4ea08fd5c5f8648e0baea8 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 22 Sep 2021 07:06:14 +0300 Subject: Update check: Heatmaps need at least 2 items Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Update the check to look for at least 2 traits before trying to generate the heatmap. --- gn3/api/heatmaps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gn3/api/heatmaps.py b/gn3/api/heatmaps.py index 0493f8a..1022a35 100644 --- a/gn3/api/heatmaps.py +++ b/gn3/api/heatmaps.py @@ -11,9 +11,9 @@ heatmaps = Blueprint("heatmaps", __name__) def clustered_heatmaps(): heatmap_request = request.get_json() traits_names = heatmap_request.get("traits_names", tuple()) - if len(traits_names) < 1: + if len(traits_names) < 2: return jsonify({ - "message": "You need to provide at least one trait name." + "message": "You need to provide at least two trait names." }), 400 conn, _cursor = database_connector() def parse_trait_fullname(trait): -- cgit v1.2.3