From b9f094768793a456c924bfd19ea3716def437483 Mon Sep 17 00:00:00 2001 From: darefalola Date: Wed, 20 Nov 2024 11:51:26 +0000 Subject: [PATCH] fix to unrecognised transcript id --- .../templates/transcript_id_not_found.html | 24 +++++++++++++++++++ tark/tark_web/views.py | 5 ++++ 2 files changed, 29 insertions(+) create mode 100644 tark/tark_web/templates/transcript_id_not_found.html diff --git a/tark/tark_web/templates/transcript_id_not_found.html b/tark/tark_web/templates/transcript_id_not_found.html new file mode 100644 index 0000000..5698f9b --- /dev/null +++ b/tark/tark_web/templates/transcript_id_not_found.html @@ -0,0 +1,24 @@ +{% extends "base.html" %} + +{% block title %}Tark home{% endblock %} + +{% load static %} + +{% block header %} + + {% include "navbar_include.html" with show_rest="true" %} + +{% endblock %} + + + +{% block content %} +
+ +

+ +

The stable id {{stable_id_with_version}} has no version. Please include the version as it is needed to find the transcript.

+ + {% include "search_big_box.html" %} + +{% endblock %} \ No newline at end of file diff --git a/tark/tark_web/views.py b/tark/tark_web/views.py index ad2dca0..370e6d9 100644 --- a/tark/tark_web/views.py +++ b/tark/tark_web/views.py @@ -399,6 +399,11 @@ def feature_diff(request, feature, from_release, to_release, direction="changed" def transcript_details(request, stable_id_with_version, search_identifier): host_url = ApiUtils.get_host_url(request) + has_stable_id_version = len(stable_id_with_version.split(".")) > 1 + + if not has_stable_id_version: + return render(request, 'transcript_id_not_found.html', context={'stable_id_with_version': stable_id_with_version}) + # get assembly name assembly_name = request.GET.get('assembly_name', '')