Remove default from format_auth_type

I think it’s better to raise an exception and force us to fix it if we ever add a new auth_type, or use this formatter on something that isn’t a valid auth_type.

Co-authored-by: Ben Thorner <benthorner@users.noreply.github.com>
This commit is contained in:
Chris Hill-Scott
2022-03-15 10:40:10 +00:00
committed by GitHub
parent 9a1a328aca
commit ff46f9beb8

View File

@@ -535,7 +535,7 @@ def format_auth_type(auth_type, with_indefinite_article=False):
'email_auth': ('an', 'Email link'),
'sms_auth': ('a', 'Text message code'),
'webauthn_auth': ('a', 'Security key'),
}.get(auth_type, ('a', auth_type))
}[auth_type]
if with_indefinite_article:
return f'{indefinite_article} {auth_type.lower()}'