Secure Source of Randomness

This commit is contained in:
pixeebot[bot]
2024-12-26 03:11:52 +00:00
committed by GitHub
parent 3f7296d7a5
commit 304812d43f
3 changed files with 10 additions and 10 deletions

View File

@@ -8,8 +8,8 @@ from rides.models import Ride
from companies.models import Company, Manufacturer
from analytics.models import PageView
from django.conf import settings
import random
import os
import secrets
def handler404(request, exception):
@@ -79,7 +79,7 @@ class HomeView(TemplateView):
# Combine and shuffle highest rated items
all_highest_rated = highest_rated_parks + highest_rated_rides
random.shuffle(all_highest_rated)
secrets.SystemRandom().shuffle(all_highest_rated)
# Keep the same context variable names for template compatibility
context['popular_parks'] = trending_parks