alchemy functions updated
This commit is contained in:
parent
be100a6615
commit
a28d4c22d1
|
|
@ -110,15 +110,23 @@ class BuildDecisionBook(CrudCollection):
|
|||
year=system_arrow.now().date().year, month=related_date.month, day=1
|
||||
)
|
||||
if system_arrow.now().date() <= date_processed:
|
||||
book = cls.filter_active(
|
||||
book = cls.filter_one(
|
||||
cls.expiry_ends <= date_processed,
|
||||
cls.decision_type == "RBM",
|
||||
cls.build_id == related_build.id,
|
||||
)
|
||||
).data
|
||||
if not book:
|
||||
return
|
||||
return book.data[0]
|
||||
else:
|
||||
cls.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="NOTFOUND",
|
||||
message=f"Decision Book is not found for {related_build.build_name}-RBM",
|
||||
data=dict(
|
||||
build_id=str(related_build.uu_id),
|
||||
build_name=related_build.build_name,
|
||||
decision_type="RBM",
|
||||
)
|
||||
)
|
||||
return book
|
||||
return
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Reference in New Issue