services are checked

This commit is contained in:
2024-11-08 17:14:02 +03:00
parent a5b1e0b2f4
commit c5b771e5cb
82 changed files with 1720 additions and 869 deletions

View File

@@ -32,7 +32,7 @@ class FilterAttributes:
status_code="HTTP_304_NOT_MODIFIED",
error_case=e.__class__.__name__,
data={},
message=str(e.__context__).split('\n')[0],
message=str(e.__context__).split("\n")[0],
)
def destroy(self):
@@ -50,7 +50,7 @@ class FilterAttributes:
status_code="HTTP_304_NOT_MODIFIED",
error_case=e.__class__.__name__,
data={},
message=str(e.__context__).split('\n')[0],
message=str(e.__context__).split("\n")[0],
)
@classmethod
@@ -93,6 +93,7 @@ class FilterAttributes:
def get_not_expired_query_arg(cls, *arg, expired=True):
"""Add expiry_starts and expiry_ends to the query."""
from api_library.date_time_actions.date_functions import system_arrow
if expired:
arg_add = (
*arg[0],
@@ -103,7 +104,7 @@ class FilterAttributes:
return arg[0]
@classmethod
def filter_by_all(cls, **kwargs):
def filter_by_all(cls, **kwargs):
"""
Filters all the records regardless of is_deleted, is_confirmed.
"""
@@ -151,10 +152,12 @@ class FilterAttributes:
cls.__session__.rollback()
raise HTTPException(
status_code=getattr(status, status_code, 'HTTP_404_NOT_FOUND'),
detail=dumps({
"data": data,
"error": error_case,
"message": message,
})
status_code=getattr(status, status_code, "HTTP_404_NOT_FOUND"),
detail=dumps(
{
"data": data,
"error": error_case,
"message": message,
}
),
)