Commit b3af1830 authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

New random method

parent 8f300a4d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ def sopds_processor(request):
        
        random_id = randint(1,Counter.objects.get_counter(models.counter_allbooks))
        try:
            random_book = Book.objects.get(id=random_id)
            #random_book = Book.objects.get(id=random_id)
            random_book = Book.objects.all()[random_id-1:random_id][0]
        except Book.DoesNotExist:
            random_book= None