mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03:30
Only consider active schedules for excluding multiple system job schedules
This commit is contained in:
parent
3b6d70f2ae
commit
04ec19023f
@ -1771,7 +1771,7 @@ class SystemJobTemplateSchedulesList(SubListCreateAPIView):
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
system_job = self.get_parent_object()
|
||||
if system_job.schedules.count() > 0:
|
||||
if system_job.schedules.filter(active=True).count() > 0:
|
||||
return Response({"error": "Multiple schedules for Systems Jobs is not allowed"}, status=status.HTTP_400_BAD_REQUEST)
|
||||
return super(SystemJobTemplateSchedulesList, self).post(request, *args, **kwargs)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user