From 12eb49bd6e0c965dfa9aa8dce3c2a9c99bac9c18 Mon Sep 17 00:00:00 2001 From: Wes Okes Date: Thu, 11 Feb 2021 16:45:04 -0500 Subject: [PATCH 1/2] atomic --- entity_emailer/interface.py | 3 ++- entity_emailer/version.py | 2 +- release_notes.rst | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/entity_emailer/interface.py b/entity_emailer/interface.py index b0a071e..e9256fb 100644 --- a/entity_emailer/interface.py +++ b/entity_emailer/interface.py @@ -2,7 +2,7 @@ import traceback from datetime import datetime - +from django.db import transaction from django.core import mail from entity_event import context_loader @@ -121,6 +121,7 @@ def convert_events_to_emails(): # Create the emails Email.objects.create_email(event=event, from_address=from_address, recipients=targets) + @transaction.atomic @staticmethod def bulk_convert_events_to_emails(): """ diff --git a/entity_emailer/version.py b/entity_emailer/version.py index cdfc74d..990636f 100644 --- a/entity_emailer/version.py +++ b/entity_emailer/version.py @@ -1 +1 @@ -__version__ = '2.0.0.1' +__version__ = '2.0.0.2' diff --git a/release_notes.rst b/release_notes.rst index 7937202..5493bfa 100644 --- a/release_notes.rst +++ b/release_notes.rst @@ -1,6 +1,10 @@ Release Notes ============= +v2.0.0.2 +------ +* Atomic decorator on event fetching + v2.0.0.1 ------ * Fix unique constraint when bulk creating emails From e85dc6163fb9d2b8f305247064b4237937413264 Mon Sep 17 00:00:00 2001 From: Wes Okes Date: Thu, 11 Feb 2021 16:47:47 -0500 Subject: [PATCH 2/2] fix order of wrap --- entity_emailer/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity_emailer/interface.py b/entity_emailer/interface.py index e9256fb..4408e1b 100644 --- a/entity_emailer/interface.py +++ b/entity_emailer/interface.py @@ -121,8 +121,8 @@ def convert_events_to_emails(): # Create the emails Email.objects.create_email(event=event, from_address=from_address, recipients=targets) - @transaction.atomic @staticmethod + @transaction.atomic def bulk_convert_events_to_emails(): """ Converts unseen events to emails and marks them as seen. Uses the create_emails method to bulk create