From 49345e3c32863f9d697aee2b28d4c641f4f466f8 Mon Sep 17 00:00:00 2001 From: DIFEZI Tchakoli Chissou Date: Mon, 22 Jul 2024 10:14:29 +0000 Subject: [PATCH] Fix: django.contrib.auth.models.User.account.RelatedObjectDoesNotExist: User has no account --- account/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account/models.py b/account/models.py index fea2e976..2ccaa229 100644 --- a/account/models.py +++ b/account/models.py @@ -44,7 +44,7 @@ class Account(models.Model): def for_request(cls, request): user = getattr(request, "user", None) if user and user.is_authenticated: - account = user.account + account = getattr(user, "account", None) if account: return account return AnonymousAccount(request)