mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-03-01 09:30:46 +00:00
Don't schedule a cycle with 0 second duration (#417)
* Don't schedule a cycle with 0 second duration * PR feedback * Getting bin_pyl to pass
This commit is contained in:
parent
1bc8ffc47d
commit
7ccb0aec62
@ -129,7 +129,15 @@ class ProcessInstanceService:
|
|||||||
for cycle in cycles:
|
for cycle in cycles:
|
||||||
db.session.delete(cycle)
|
db.session.delete(cycle)
|
||||||
|
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
if cycle_count != 0:
|
if cycle_count != 0:
|
||||||
|
if duration_in_seconds == 0:
|
||||||
|
raise ApiError(
|
||||||
|
error_code="process_model_cycle_has_0_second_duration",
|
||||||
|
message="Can not schedule a process model cycle with a duration in seconds of 0.",
|
||||||
|
)
|
||||||
|
|
||||||
cycle = ProcessModelCycleModel(
|
cycle = ProcessModelCycleModel(
|
||||||
process_model_identifier=process_model_identifier,
|
process_model_identifier=process_model_identifier,
|
||||||
cycle_count=cycle_count,
|
cycle_count=cycle_count,
|
||||||
@ -137,7 +145,6 @@ class ProcessInstanceService:
|
|||||||
current_cycle=0,
|
current_cycle=0,
|
||||||
)
|
)
|
||||||
db.session.add(cycle)
|
db.session.add(cycle)
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user