mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 13:11:08 -05:00
Secure Source of Randomness
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user