diff --git a/service_catalog/models/approval_workflow.py b/service_catalog/models/approval_workflow.py index 330517889..444e31dca 100644 --- a/service_catalog/models/approval_workflow.py +++ b/service_catalog/models/approval_workflow.py @@ -21,7 +21,8 @@ class ApprovalWorkflow(SquestModel): 'profiles.Scope', related_name='approval_workflows', blank=True, - verbose_name="Restricted scopes" + verbose_name="Restricted scopes", + help_text="This workflow will be triggered for the following scopes. Leave empty to trigger for all scopes" ) @property diff --git a/service_catalog/views/operation.py b/service_catalog/views/operation.py index 7d5a52e38..b5a3d160b 100644 --- a/service_catalog/views/operation.py +++ b/service_catalog/views/operation.py @@ -3,7 +3,8 @@ from Squest.utils.squest_views import * from service_catalog.filters.operation_filter import OperationFilter, OperationFilterLimited from service_catalog.forms import ServiceOperationForm -from service_catalog.models import Operation, Service, OperationType +from service_catalog.models import Operation, Service, OperationType, ApprovalWorkflow +from service_catalog.tables.approval_workflow_table import ApprovalWorkflowTable from service_catalog.tables.operation_tables import OperationTable, CreateOperationTable @@ -78,6 +79,8 @@ def get_context_data(self, **kwargs): } ] context['extra_html_button_path'] = "service_catalog/buttons/operation_survey_button.html" + if self.request.user.has_perm('service_catalog.view_approvalworkflow'): + context['workflows_table'] = ApprovalWorkflowTable(ApprovalWorkflow.objects.filter(operation=self.get_object()),exclude=['operation']) return context diff --git a/templates/service_catalog/operation_detail.html b/templates/service_catalog/operation_detail.html index 1ee5447e4..a78f81a9b 100644 --- a/templates/service_catalog/operation_detail.html +++ b/templates/service_catalog/operation_detail.html @@ -7,6 +7,7 @@ {% include 'service_catalog/buttons/delete_operation_button.html' %} {% endblock %} {% block main %} + {% load django_tables2 %}
{{ object.extra_vars | pretty_json }}