Skip to content

Commit

Permalink
throw error if resources are missing in schedule
Browse files Browse the repository at this point in the history
Issue: AAP-25659
  • Loading branch information
jerabekjiri committed Jun 20, 2024
1 parent 650c552 commit e543a48
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/awx/views/schedules/wizard/ScheduleAddWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ export function ScheduleAddWizard() {
const { inventory, project, organization } = resource.summary_fields;

if (
(resource?.type === 'job_template' && (!inventory || !project || !organization)) ||
(resource?.type === 'workflow_job_template' && (!inventory || !organization))
(resource?.type === 'job_template' &&
((!inventory && !resource.ask_inventory_on_launch) || !project || !organization)) ||
(resource?.type === 'workflow_job_template' &&
((!inventory && !resource.ask_inventory_on_launch) || !organization))
) {
const errors = {
__all__: [t('Resources are missing from this template.')],
Expand Down

0 comments on commit e543a48

Please sign in to comment.