Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_context(self, request, *args, **kwargs):
entries = EntryPage.objects.live().order_by('-date')[0:3]
blog_page = BlogPage.objects.all().first()
context = super(HomePage, self).get_context(request, *args, **kwargs)
context['entries'] = entries
context['blog_page'] = blog_page
quotes = Quote.objects.all()
if quotes:
quote = random.choice(Quote.objects.all())
context['quote'] = quote
# user = request.user
# if user.is_authenticated and user.is_league_member:
# now = timezone.now()
# opponents = user.get_opponents()
# if opponents is False:
# context['should_join'] = True
# else:
# availables = AvailableEvent.objects.filter(
# end__gte=now,