fix re-enable token on closed camapign + refacto war_event attributes

This commit is contained in:
Maxime Réaux 2026-02-25 16:54:21 +01:00
parent 5c124f9229
commit 6efd22527a
8 changed files with 108 additions and 57 deletions

View file

@ -63,19 +63,32 @@ class WarEvent:
class TieResolved(WarEvent):
TYPE = "TieResolved"
def __init__(self, participant_id: str | None, context_type: str, context_id: str):
def __init__(
self,
participant_id: str | None,
context_type: str,
context_id: str,
score_value: int | None = None,
):
super().__init__(participant_id, context_type, context_id)
self.score_value = score_value
def toDict(self) -> Dict[str, Any]:
d = super().toDict()
d.update(
{
"score_value": self.score_value or None,
}
)
return d
@classmethod
def fromDict(cls, data: Dict[str, Any]) -> TieResolved:
ev = cls(
data["participant_id"],
data["participant_id"] or None,
data["context_type"],
data["context_id"],
data["score_value"] or None,
)
return cls._base_fromDict(ev, data)