Filter triggered builds when checking concurrency
@@ -14,6 +14,7 @@ from readthedocs.builds.constants import (
BRANCH,
TAG,
INTERNAL,
+ BUILD_STATE_TRIGGERED,
BUILD_STATE_FINISHED,
)
from readthedocs.builds.models import Build, BuildCommandResult, Version
@@ -291,7 +292,7 @@ class BuildViewSetBase(UserSelectViewSet):
queryset = (
self.get_queryset()
.filter(project__slug=project_slug)
- .exclude(state__in=[BUILD_STATE_FINISHED])
+ .exclude(state__in=[BUILD_STATE_TRIGGERED, BUILD_STATE_FINISHED])
)
return Response({'count': queryset.count()})
