sources/oauth: slugify provider type instead of just lowercase
This commit is contained in:
parent
b2c10e2387
commit
f4a676e2fb
|
@ -21,6 +21,5 @@ class PassbookSourceOAuthConfig(AppConfig):
|
|||
for source_type in settings.PASSBOOK_SOURCES_OAUTH_TYPES:
|
||||
try:
|
||||
import_module(source_type)
|
||||
LOGGER.info("Loaded source_type", source_class=source_type)
|
||||
except ImportError as exc:
|
||||
LOGGER.debug(exc)
|
||||
|
|
|
@ -35,7 +35,7 @@ class OAuthSource(Source):
|
|||
"passbook_sources_oauth:oauth-client-login",
|
||||
kwargs={"source_slug": self.slug},
|
||||
),
|
||||
icon_path=f"passbook/sources/{self.provider_type.replace(' ', '-')}.svg",
|
||||
icon_path=f"passbook/sources/{self.provider_type}.svg",
|
||||
name=self.name,
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""Source type manager"""
|
||||
from enum import Enum
|
||||
|
||||
from django.utils.text import slugify
|
||||
from structlog import get_logger
|
||||
|
||||
from passbook.sources.oauth.views.core import OAuthCallback, OAuthRedirect
|
||||
|
@ -36,7 +37,7 @@ class SourceTypeManager:
|
|||
|
||||
def get_name_tuple(self):
|
||||
"""Get list of tuples of all registered names"""
|
||||
return [(x.lower(), x) for x in set(self.__names)]
|
||||
return [(slugify(x), x) for x in set(self.__names)]
|
||||
|
||||
def find(self, source, kind):
|
||||
"""Find fitting Source Type"""
|
||||
|
|
Reference in a new issue