Skip to content

Notifications: Continuer à envoyer les notifications aux anciens collaborateurs#5354

Merged
tonial merged 1 commit intomasterfrom
alaurent/referents
Jan 7, 2025
Merged

Notifications: Continuer à envoyer les notifications aux anciens collaborateurs#5354
tonial merged 1 commit intomasterfrom
alaurent/referents

Conversation

@tonial
Copy link
Contributor

@tonial tonial commented Jan 7, 2025

For now.

🤔 Pourquoi ?

Indiquez le problème que nous sommes en train de résoudre et les objectifs métiers ou techniques qui sont visés par ces changements.

🍰 Comment ?

Décrivez en quelques mots la solution retenue et mise en oeuvre, les difficultés ou problèmes rencontrés. Attirez l'attention sur les décisions d'architecture ou de conception importantes.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?

🏝️ Comment tester

Les instructions pour reproduire le problème, les profils de test, le parcours spécifique à utiliser, etc. Si vous disposez d'une recette jetable, mettre l'URL pour tester dans cette partie.

💻 Captures d'écran

@tonial tonial added the modifié Modifié dans le changelog. label Jan 7, 2025
@tonial tonial self-assigned this Jan 7, 2025
assert len(mailoutbox) == 2
assert set(mailoutbox[0].to + mailoutbox[1].to) == {admin_1.email, admin_2.email}
assert len(mailoutbox) == 3
assert set(sum((mail.to for mail in mailoutbox), [])) == {admin_1.email, admin_2.email, self.user.email}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert set(sum((mail.to for mail in mailoutbox), [])) == {admin_1.email, admin_2.email, self.user.email}
assert set(*(mail.to for mail in mailoutbox)) == {admin_1.email, admin_2.email, self.user.email}

Copy link
Contributor Author

@tonial tonial Jan 7, 2025

Choose a reason for hiding this comment

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

Je vois pas comment ça pourrait marcher vu que mail.to est une liste.
A priori il n'y a qu'un seul élément dedans, mais c'est mieux de le vérifier

Sinon on peut faire assert set(mail.to[0] for mail in mailoutbox) == {admin_1.email, admin_2.email, user.email}

Copy link
Contributor

Choose a reason for hiding this comment

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

arf effectivement 🤦

Tu as aussi set(itertools.chain.from_iterable(mail.to for mail in mailoutbox)) en alternative 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, ça c'est cool, je connaissais pas !

assert len(mailoutbox) == 2
assert set(mailoutbox[0].to + mailoutbox[1].to) == {admin_1.email, admin_2.email}
assert len(mailoutbox) == 3
assert set(sum((mail.to for mail in mailoutbox), [])) == {admin_1.email, admin_2.email, user.email}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert set(sum((mail.to for mail in mailoutbox), [])) == {admin_1.email, admin_2.email, user.email}
assert set(*(mail.to for mail in mailoutbox)) == {admin_1.email, admin_2.email, user.email}

@tonial tonial added this pull request to the merge queue Jan 7, 2025
@tonial
Copy link
Contributor Author

tonial commented Jan 7, 2025

Je merge pour rétablir le bon fonctionnement, mais la discussion sur ta syntaxe alternative n'est pas fermée : je passe peut être à côté d'un truc cool de python alors ça m'intéresse de savoir ce qu'il en est :)

Merged via the queue into master with commit 4cdf2fc Jan 7, 2025
10 checks passed
@tonial tonial deleted the alaurent/referents branch January 7, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants