Skip to content

Commit

Permalink
fix(usersessions): Emit signal outside of the transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Sep 12, 2024
1 parent 4338596 commit b55c662
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion allauth/usersessions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def create_from_request(self, request):
user_agent=ua,
)

from_session = None
with transaction.atomic():
from allauth.usersessions.signals import session_client_changed

Expand All @@ -68,7 +69,7 @@ def create_from_request(self, request):

session.save()

if (
if from_session and (
from_session.ip != session.ip
or from_session.user_agent != session.user_agent
):
Expand Down

0 comments on commit b55c662

Please sign in to comment.