From 8ab760d456356a5a6c50fef9e51ec23e566b1321 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Fri, 24 Jun 2022 16:53:01 -0700 Subject: [PATCH] Fix small type annotation bug Signed-off-by: Alek Ratzloff --- board/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/utils.py b/board/utils.py index c94fd9a..4a1fe79 100644 --- a/board/utils.py +++ b/board/utils.py @@ -1,4 +1,4 @@ -from typing import TYPE_CHECKING +from typing import Optional, TYPE_CHECKING from django.utils import timezone import ipaddress @@ -33,7 +33,7 @@ def get_ip_bans(ip: str) -> list: return bans -def is_banned(ip: str, board: "Board" | None) -> bool: +def is_banned(ip: str, board: Optional["Board"]) -> bool: now = timezone.now() bans = [ban for ban in get_ip_bans(ip) if ban.board == board or not ban.board] if bans: