Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nouveau champ User.logs #1984

Merged
merged 3 commits into from
Jun 25, 2023
Merged

Nouveau champ User.logs #1984

merged 3 commits into from
Jun 25, 2023

Conversation

raphodn
Copy link
Member

@raphodn raphodn commented Jun 23, 2023

Quoi ?

Nouveau champ logs pour logger de la metadata au format JSON pour chaque utilisateur.

Exemple :

  • date de l'opt-in ou l'opt-out à une fonctionnalité
  • envoi d'un e-mail

@raphodn raphodn self-assigned this Jun 23, 2023
@raphodn raphodn requested a review from dq18 June 23, 2023 17:46

if jsonfield_data:
result = json.dumps(jsonfield_data, indent=4, ensure_ascii=False)
result = mark_safe(f"<pre>{escape(result)}</pre>")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'utiliserais plutôt:
result = format_html('<pre>{}</pre>', result)
Il semble que c'est plus sécurisé et ça évite 2 appels de fonctions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en effet ca produit le même résultat !
mais bizarrement result = format_html(f"<pre>{result}</pre>") produit une erreur

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modifié ici : 816e70a

@raphodn raphodn merged commit a4036ed into master Jun 25, 2023
1 check passed
@raphodn raphodn deleted the raphodn/user-logs branch June 25, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants