Skip to content
Snippets Groups Projects
Commit 69bdd24f authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

fixed #130

parent d7a76ebf
No related branches found
No related tags found
1 merge request!128Merge improve testing
...@@ -47,9 +47,10 @@ def get_annotated_tutor_list() -> QuerySet: ...@@ -47,9 +47,10 @@ def get_annotated_tutor_list() -> QuerySet:
def get_random_element_from_queryset(queryset): def get_random_element_from_queryset(queryset):
length = queryset.count() qs_elements = queryset.all()
length = len(qs_elements)
index = secrets.choice(range(length)) index = secrets.choice(range(length))
return queryset.all()[index] return qs_elements[index]
class ExamType(models.Model): class ExamType(models.Model):
......
...@@ -92,6 +92,7 @@ DATABASES = { ...@@ -92,6 +92,7 @@ DATABASES = {
'PASSWORD': os.environ.get('DB_PASSWORD', 'postgres'), 'PASSWORD': os.environ.get('DB_PASSWORD', 'postgres'),
'HOST': os.environ.get('DB_HOST', 'localhost'), 'HOST': os.environ.get('DB_HOST', 'localhost'),
'PORT': os.environ.get('DB_PORT', '5432'), 'PORT': os.environ.get('DB_PORT', '5432'),
'ATOMIC_REQUESTS': True
}, },
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment