diff --git a/website/contrib/unsplash/apps.py b/website/contrib/unsplash/apps.py deleted file mode 100644 index 8da7dd5..0000000 --- a/website/contrib/unsplash/apps.py +++ /dev/null @@ -1,11 +0,0 @@ -from django.apps import AppConfig -from health_check.plugins import plugin_dir - - -class UnsplashAppConfig(AppConfig): - name = "website.contrib.unsplash" - - def ready(self) -> None: - from .healthchecks import UnsplashHealthCheckBackend - - plugin_dir.register(UnsplashHealthCheckBackend) diff --git a/website/contrib/unsplash/healthchecks.py b/website/contrib/unsplash/healthchecks.py deleted file mode 100644 index 97adfcf..0000000 --- a/website/contrib/unsplash/healthchecks.py +++ /dev/null @@ -1,20 +0,0 @@ -import requests -from django.conf import settings -from health_check.backends import BaseHealthCheckBackend - - -class UnsplashHealthCheckBackend(BaseHealthCheckBackend): - def check_status(self) -> None: - try: - requests.get( - "https://api.unsplash.com/me", - headers={ - "Accept-Version": "v1", - "Authorization": f"Client-ID {settings.UNSPLASH_CLIENT_ID}", - }, - ).raise_for_status() - except Exception as e: - self.add_error(str(e)) - - def identifier(self) -> str: - return "Unsplash API"