diff --git a/sample_deployment/sample_deployment/example/views.py b/sample_deployment/sample_deployment/example/views.py index 90a4235..914957e 100644 --- a/sample_deployment/sample_deployment/example/views.py +++ b/sample_deployment/sample_deployment/example/views.py @@ -10,7 +10,9 @@ class HomePageView(TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) if self.request.user.is_authenticated: - social_account = SocialAccount.objects.first() # pylint: disable=no-member + social_account = SocialAccount.objects.filter( + user=self.request.user + ).first() # pylint: disable=no-member if social_account: context["extra_data"] = social_account.extra_data return context @@ -22,7 +24,9 @@ class SocialAccountMetadataView(TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) if self.request.user.is_authenticated: - social_account = SocialAccount.objects.first() # pylint: disable=no-member + social_account = SocialAccount.objects.filter( + user=self.request.user + ).first() # pylint: disable=no-member if social_account: context["extra_data"] = social_account.extra_data json_str = json.dumps(social_account.extra_data, indent=2)