Skip to content

Commit

Permalink
feat(urls): Add error logging for provider imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti Viitala committed Nov 27, 2023
1 parent dbdf6cb commit 9180ec1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions allauth/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from importlib import import_module

from django.urls import include, path
Expand All @@ -7,6 +8,9 @@
from . import app_settings


logger = logging.getLogger(__name__)


urlpatterns = [path("", include("allauth.account.urls"))]
if app_settings.MFA_ENABLED:
urlpatterns += [path("2fa/", include("allauth.mfa.urls"))]
Expand All @@ -27,6 +31,7 @@
try:
prov_mod = import_module(provider_class.get_package() + ".urls")
except ImportError:
logger.error(f"Unable to import allauth provider: {provider_class.id}: ({e}).")
continue
prov_urlpatterns = getattr(prov_mod, "urlpatterns", None)
if prov_urlpatterns:
Expand Down

0 comments on commit 9180ec1

Please sign in to comment.