feat: add ban override management to IP statistics model and database manager

This commit is contained in:
Lorenzo Venerandi
2026-03-08 12:26:02 +01:00
parent 53c23d2d18
commit 8a651b00f9
2 changed files with 102 additions and 0 deletions

View File

@@ -210,6 +210,11 @@ class IpStats(Base):
total_violations: Mapped[int] = mapped_column(Integer, default=0, nullable=True)
ban_multiplier: Mapped[int] = mapped_column(Integer, default=1, nullable=True)
# Admin ban override: True = force ban, False = force unban, None = automatic
ban_override: Mapped[Optional[bool]] = mapped_column(
Boolean, nullable=True, default=None
)
def __repr__(self) -> str:
return f"<IpStats(ip='{self.ip}', total_requests={self.total_requests})>"