Skip to content

Commit

Permalink
Simplify type-hints
Browse files Browse the repository at this point in the history
  • Loading branch information
ababic authored and gasman committed Jun 4, 2024
1 parent c7caa45 commit 234d928
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions wagtail/contrib/frontend_cache/backends/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
from collections.abc import Iterable

from django.http.request import validate_host

Expand All @@ -14,15 +13,15 @@ def __init__(self, params):
# If unspecified, invalidate all hosts
self.hostnames = params.get("HOSTNAMES", ["*"])

def purge(self, url: str) -> None:
def purge(self, url) -> None:
raise NotImplementedError

def purge_batch(self, urls: Iterable[str]) -> None:
def purge_batch(self, urls) -> None:
# Fallback for backends that do not support batch purging
for url in urls:
self.purge(url)

def invalidates_hostname(self, hostname: str) -> bool:
def invalidates_hostname(self, hostname) -> bool:
"""
Can `hostname` be invalidated by this backend?
"""
Expand Down

0 comments on commit 234d928

Please sign in to comment.