openfun / joanie

👛 A headless ERP for education to manage course enrollment/subscription, payment and certificates delivery.
MIT License
20 stars 2 forks source link

🐛(user) prevent newsletter subscription created twice on user creation #761

Closed jbpenrath closed 3 months ago

jbpenrath commented 3 months ago

Purpose

As we are creating user on the fly during api requests, sometimes we can try to create a user twice. In this case save method raise an IntegrityError but as the subscription logic is put before the model save, this one is executed even if the save fails that is weird.

Proposal