Skip to content

Commit

Permalink
refactor(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 9f63e7c commit 4338596
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions allauth/usersessions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ def create_from_request(self, request):

session.save()

if (
from_session.ip != session.ip
or from_session.user_agent != session.user_agent
):
session_client_changed.send(
sender=UserSession,
request=request,
from_session=from_session,
to_session=session,
)
if (
from_session.ip != session.ip
or from_session.user_agent != session.user_agent
):
session_client_changed.send(
sender=UserSession,
request=request,
from_session=from_session,
to_session=session,
)


class UserSession(models.Model):
Expand Down

0 comments on commit 4338596

Please sign in to comment.