mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-22 16:03:00 +08:00
finalise external dependency loosening"
This commit is contained in:
parent
cd1f3e9a1d
commit
1cd35d4377
3 changed files with 10 additions and 3 deletions
|
@ -7,7 +7,7 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def change_tracker(action: str, table_name: str, metadata):
|
||||
logger.info(f"Event fired: {action}:{table_name}")
|
||||
# logger.info(f"Event fired: {action}:{table_name} --> NotUsed")
|
||||
if not metadata:
|
||||
return
|
||||
|
||||
|
@ -17,6 +17,7 @@ def change_tracker(action: str, table_name: str, metadata):
|
|||
**metadata.get("state_after")
|
||||
}
|
||||
|
||||
# Hook thinks like meilisearch here etc
|
||||
# SomeHandler().on_event(action, table_name, metadata)
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,9 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
async def auditlog_tracker(action: str, table_name: str, metadata):
|
||||
if settings.AUDITABLE_ENTITIES and table_name not in settings.AUDITABLE_ENTITIES:
|
||||
return
|
||||
|
||||
if action != "after-update" and not metadata:
|
||||
return
|
||||
|
||||
|
@ -19,7 +22,7 @@ async def auditlog_tracker(action: str, table_name: str, metadata):
|
|||
if metadata["state_after"] == metadata["state_before"]:
|
||||
return
|
||||
|
||||
logger.info(f"Event fired: {action}:{table_name}")
|
||||
logger.info(f"Event fired: {action}:{table_name} --> AuditLogEntry")
|
||||
update = {
|
||||
**metadata,
|
||||
"user_uid": metadata["state_after"].get("updated_by_uid", None),
|
||||
|
|
|
@ -138,7 +138,10 @@ class Settings(BaseSettings):
|
|||
DOCUMENT_STORAGE: bool = bool(MONGODB_SERVER) and bool(MONGODB_USER) and bool(MONGODB_PASS)
|
||||
# Use external storage for objects/blobs
|
||||
OBJECT_STORAGE: bool = bool(MINIO_SERVER) and bool(MINIO_ACCESS) and bool(MINIO_SECRET)
|
||||
|
||||
# Limit Tables for audit-log: if empty, all will be audited
|
||||
AUDITABLE_ENTITIES: list[str] = [
|
||||
"sample", "analysis_result", "test_bill", "client", "patient"
|
||||
]
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=ENV_FILE,
|
||||
env_file_encoding="utf-8",
|
||||
|
|
Loading…
Reference in a new issue