Use PermissionDenied instead of Connector exception for disallow

federation
This commit is contained in:
Mouse Reeve 2024-08-27 14:04:48 -07:00
parent a5ae9c86a8
commit 877b818470

View file

@ -12,7 +12,6 @@ from django.utils import timezone
from model_utils import FieldTracker
from bookwyrm.connectors.abstract_connector import get_data
from bookwyrm.connectors import ConnectorException
from bookwyrm.preview_images import generate_site_preview_image_task
from bookwyrm.settings import BASE_URL, ENABLE_PREVIEW_IMAGES, STATIC_FULL_URL
from bookwyrm.settings import RELEASE_API
@ -137,7 +136,7 @@ class SiteSettings(SiteModel):
def raise_federation_disabled(self):
"""Don't connect to the outside world"""
if self.disable_federation:
raise ConnectorException("Federation is disabled")
raise PermissionDenied("Federation is disabled")
def get_url(self, field, default_path):
"""get a media url or a default static path"""