events imports are checked

This commit is contained in:
2024-11-08 15:05:12 +03:00
parent 643d6d8f65
commit a5b1e0b2f4
71 changed files with 2517 additions and 312 deletions

View File

@@ -53,6 +53,19 @@ class Modules(CrudCollection):
module_layer = mapped_column(Integer, nullable=False, comment="Module Layer")
is_default_module = mapped_column(Boolean, server_default="0")
def retrieve_services(self):
services = Services.filter_all(Services.module_id == self.id)
if not services.count:
self.raise_http_exception(
status_code="HTTP_404_NOT_FOUND",
error_case="RECORD_NOT_FOUND",
message=f"No services found for this module : {str(self.uu_id)}",
data={
"module_uu_id": str(self.uu_id),
},
)
return services.data
__table_args__ = ({"comment": "Modules Information"},)