Skip to content

Commit

Permalink
docs: fix - sample_deployment display user avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
danihodovic committed Jun 20, 2024
1 parent 7efc0db commit 77a02fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sample_deployment/sample_deployment/example/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 77a02fa

Please sign in to comment.