Skip to content
Snippets Groups Projects
Commit 651ac402 authored by Jo Sama's avatar Jo Sama :scream:
Browse files

Make BatchProgressEnum inherit from str

This allows more readable code, as we can do

  if batch.batch_progress == BatchProgressEnum.VALIDATION_FAILED:

instead of

  if batch.batch_progress == str(BatchProgressEnum.VALIDATION_FAILED):

or

  if batch.batch_progress == BatchProgressEnum.VALIDATION_FAILED.value:
parent 57e32e0b
No related branches found
No related tags found
1 merge request!17Refactor models and methods for batches
Pipeline #81841 passed
......@@ -27,7 +27,7 @@ class BaseModel(pydantic.BaseModel):
return cls.from_dict(data)
class BatchProgressEnum(Enum):
class BatchProgressEnum(str, Enum):
CREATED = 'created'
VALIDATION_COMPLETED = 'validation_completed'
VALIDATION_FAILED = 'validation_failed'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment