Fix small type annotation bug

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-24 16:53:01 -07:00
parent a3bf5098ba
commit 8ab760d456

View File

@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING from typing import Optional, TYPE_CHECKING
from django.utils import timezone from django.utils import timezone
import ipaddress import ipaddress
@@ -33,7 +33,7 @@ def get_ip_bans(ip: str) -> list:
return bans return bans
def is_banned(ip: str, board: "Board" | None) -> bool: def is_banned(ip: str, board: Optional["Board"]) -> bool:
now = timezone.now() now = timezone.now()
bans = [ban for ban in get_ip_bans(ip) if ban.board == board or not ban.board] bans = [ban for ban in get_ip_bans(ip) if ban.board == board or not ban.board]
if bans: if bans: