Skip to content

Commit c938090

Browse files
Adds missing transaction using for notification unsub
1 parent 71f8c8c commit c938090

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sentry/web/frontend/unsubscribe_notifications.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import abc
22

3-
from django.db import transaction
3+
from django.db import router, transaction
44
from django.http import Http404, HttpResponse, HttpResponseRedirect
55
from django.utils.decorators import method_decorator
66
from django.views.decorators.cache import never_cache
@@ -19,7 +19,7 @@ class UnsubscribeBaseView(BaseView, metaclass=abc.ABCMeta):
1919
@never_cache
2020
@signed_auth_required_m
2121
def handle(self, request: Request, **kwargs) -> HttpResponse:
22-
with transaction.atomic():
22+
with transaction.atomic(router.db_for_write(OrganizationMember)):
2323
if not getattr(request, "user_from_signed_request", False):
2424
raise Http404
2525

0 commit comments

Comments
 (0)