diff --git a/postgrestutils/_django_utils.py b/postgrestutils/_django_utils.py index b08afc7ed401a58e8f05563b983cb330332cb5c2..b552a1c6f2dcdf810c29f17b29481f4224ae171d 100644 --- a/postgrestutils/_django_utils.py +++ b/postgrestutils/_django_utils.py @@ -30,8 +30,8 @@ def autofetch(sender, **kwargs): else: payload['auth_provider_uid'] = 'eq.{}'.format(kwargs['user'].sso_mapping.uuid) - with postgrestutils.conn() as c: - account = c.get('account', params=payload) + with postgrestutils.Session() as s: + account = s.get('account', params=payload) user_account_fetched.send(sender=None, request=kwargs['request'], account=account)