From 7a3601d6a0d3c496df8c3a8320855219c63a8a6a Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 7 Jul 2017 14:28:37 -0400 Subject: [PATCH] Organization should be required when !superuser are creating a workflow --- awx/ui/client/src/templates/workflows.form.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/templates/workflows.form.js b/awx/ui/client/src/templates/workflows.form.js index 07b470b9c3..b03b7bef47 100644 --- a/awx/ui/client/src/templates/workflows.form.js +++ b/awx/ui/client/src/templates/workflows.form.js @@ -51,6 +51,9 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) { dataTitle: i18n._('Organization'), dataContainer: 'body', dataPlacement: 'right', + awRequiredWhen: { + reqExpression: '!current_user.is_superuser' + }, column: 1, ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate) || !canEditOrg', awLookupWhen: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate) && canEditOrg' @@ -98,7 +101,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) { }, save: { ngClick: 'formSave()', //$scope.function to call on click, optional - ngDisabled: "workflow_form.$invalid || can_edit!==true", //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons + ngDisabled: "workflow_job_template_form.$invalid || can_edit!==true", //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)' } },