betagouv / django-magicauth

Password-less authentication for Django. An email with a magic link allows a secure login

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make the token not found warning configurable

zagl opened this issue · comments

commented

Currently the message text is hard-coded which is a problem if someone wants to change the language. It would be better if the text was a variable in settings.py.

messages.warning(
self.request,
"Ce lien de connexion ne fonctionne plus. "
"Pour en recevoir un nouveau, nous vous invitons à renseigner "
"votre email ci-dessous puis à cliquer sur valider.",
)

Hi @zagl , thanks for the issue.
Do you need this language customisation ? Is it blocking your adoption ? Or is it just a nice-to-have ?

I'd advocate in favour of using translations mechanisms for this kind of customisations to avoid polluting the settings.py.

commented

Hi @zagl , thanks for the issue. Do you need this language customisation ? Is it blocking your adoption ? Or is it just a nice-to-have ?

I need it, yes. But it is not blocking at the moment. I just override the get method completely.

I'd advocate in favour of using translations mechanisms for this kind of customisations to avoid polluting the settings.py.

That sounds reasonable.