Skip to content

Commit b447e95

Browse files
committed
convert some of the test model hooks to on_commit
1 parent 50cf49d commit b447e95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/testapp/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def lowercase_email(self):
5151
def timestamp_joined_at(self):
5252
self.joined_at = timezone.now()
5353

54-
@hook("after_create")
54+
@hook("after_create", on_commit=True)
5555
def do_after_create_jobs(self):
5656
# queue background job to process thumbnail image...
5757
mail.send_mail(
@@ -75,7 +75,7 @@ def ensure_trial_not_active(self):
7575
def ensure_last_name_is_not_changed_to_flanders(self):
7676
raise CannotRename("Oh, not Flanders. Anybody but Flanders.")
7777

78-
@hook("after_update", when="organization.name", has_changed=True)
78+
@hook("after_update", when="organization.name", has_changed=True, on_commit=True)
7979
def notify_org_name_change(self):
8080
mail.send_mail(
8181
"The name of your organization has changed!",

0 commit comments

Comments
 (0)