Skip to content

Commit

Permalink
fix: Allow pipeline enable / disable done through PATCH calls (#636)
Browse files Browse the repository at this point in the history
Regression fix: Allow pipeline enable / disable done through PATCH calls
  • Loading branch information
chandrasekharan-zipstack authored Aug 31, 2024
1 parent 5d120b1 commit db818f3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/pipeline/serializers/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ def create(self, validated_data: dict[str, Any]) -> Any:
return super().create(validated_data)

def save(self, **kwargs: Any) -> Pipeline:
if self.validated_data[PK.CRON_STRING]:
self.validated_data[PK.SCHEDULED] = True
else:
self.validated_data[PK.SCHEDULED] = False
if PK.CRON_STRING in self.validated_data:
if self.validated_data[PK.CRON_STRING]:
self.validated_data[PK.SCHEDULED] = True
else:
self.validated_data[PK.SCHEDULED] = False
pipeline: Pipeline = super().save(**kwargs)
if pipeline.cron_string is None:
SchedulerHelper.remove_job(pipeline_id=str(pipeline.id))
Expand Down

0 comments on commit db818f3

Please sign in to comment.