diff --git a/bayer/views.py b/bayer/views.py index bec38f38..47d86e8f 100644 --- a/bayer/views.py +++ b/bayer/views.py @@ -8,7 +8,7 @@ from django.shortcuts import redirect from bayer.models import PESCompound from epdb.logic import PackageManager from epdb.models import Pathway, Node -from epdb.views import _anonymous_or_real +from epdb.views import _anonymous_or_real, error from utilities.decorators import package_permission_required Package = s.GET_PACKAGE_MODEL() @@ -22,7 +22,11 @@ def create_pes(request, package_uuid): if request.method == "POST": if current_package.classification_level == Package.Classification.INTERNAL: - raise HttpResponseBadRequest("Cannot create PESs for internal packages.") + return error( + request, + f'Creation of PESs for package {current_package.name} failed!', + "Creating PESs for internal packages is not allowed.", + ) compound_name = request.POST.get('compound-name') compound_description = request.POST.get('compound-description') @@ -64,7 +68,11 @@ def create_pes_node(request, package_uuid, pathway_uuid): if request.method == "POST": if current_package.classification_level == Package.Classification.INTERNAL: - raise HttpResponseBadRequest("Cannot create PESs for internal packages.") + return error( + request, + f'Creation of PESs for package {current_package.name} failed!', + "Creating PESs for internal packages is not allowed.", + ) compound_name = request.POST.get('compound-name') compound_description = request.POST.get('compound-description') diff --git a/templates/objects/pathway.html b/templates/objects/pathway.html index 9cd9cf58..1ebfab4c 100644 --- a/templates/objects/pathway.html +++ b/templates/objects/pathway.html @@ -202,6 +202,7 @@ {% endif %} + {% if 1 == 0 %}
  • + {% endif %}