From 572647aeb173f5f92a6af60fe83f134491931a7a Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Thu, 27 Jun 2024 11:31:00 +0200 Subject: [PATCH] models.file:File.action_data - ensure it is never None --- acacore/models/file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acacore/models/file.py b/acacore/models/file.py index 17b9498..5eb037d 100644 --- a/acacore/models/file.py +++ b/acacore/models/file.py @@ -84,7 +84,7 @@ class File(BaseModel): signature: str | None warning: list[str] | None = None action: TActionType | None = DBField(index=["idx_action"]) - action_data: ActionData | None = None + action_data: ActionData = ActionData() processed: bool = False lock: bool = False root: Path | None = DBField(None, ignore=True) @@ -269,7 +269,7 @@ def get_action( action: Action | None = reduce(lambda acc, cur: acc or actions.get(cur), identifiers, None) if set_match: - self.action, self.action_data = action.action if action else None, action.action_data if action else None + self.action, self.action_data = action.action if action else None, action.action_data if action else ActionData() return action