Fix small type annotation bug
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user