Skip to content

Commit

Permalink
docs: fix - sample_deployment display user avatar (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
danihodovic authored Jun 20, 2024
1 parent 7efc0db commit 07c27d1
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 07c27d1

Please sign in to comment.