From a12e43a14c835cbc7ba14c3b7d5271271e4e27d2 Mon Sep 17 00:00:00 2001 From: Laurent Gil Date: Fri, 19 Apr 2024 10:06:53 +0100 Subject: [PATCH] Fix CSRF issue with the Browse Publications page --- catalog/urls.py | 2 +- catalog/views.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/catalog/urls.py b/catalog/urls.py index 1769b0f0..e211b450 100755 --- a/catalog/urls.py +++ b/catalog/urls.py @@ -36,7 +36,7 @@ # e.g.: /browse/traits/ path('browse/traits/', cache_page(cache_time)(views.browse_traits), name='Browse Traits'), # e.g.: /browse/studies/ - path('browse/studies/', cache_page(cache_time)(views.browse_publications), name='Browse Publications'), + path('browse/studies/', views.browse_publications, name='Browse Publications'), # e.g.: /latest_release/ path('latest_release/', cache_page(cache_time)(views.latest_release), name='Latest Release'), diff --git a/catalog/views.py b/catalog/views.py index e0b21a6f..e1fb6e34 100644 --- a/catalog/views.py +++ b/catalog/views.py @@ -349,7 +349,7 @@ def browse_scores(request): page_rows_number = len(table.page) page_number = table.page.number table.row_start = rows_per_page * (page_number - 1) + 1 - table.row_end = table.row_start - 1 + page_rows_number; + table.row_end = table.row_start - 1 + page_rows_number context = { 'view_name': 'Polygenic Scores (PGS)', @@ -432,7 +432,7 @@ def browse_publications(request): page_rows_number = len(table.page) page_number = table.page.number table.row_start = rows_per_page * (page_number - 1) + 1 - table.row_end = table.row_start - 1 + page_rows_number; + table.row_end = table.row_start - 1 + page_rows_number context = { 'view_name': 'Publications', @@ -696,7 +696,7 @@ def efo(request, efo_id): return redirect_with_upper_case_id(request, url_dir, efo_id) exclude_children = False - include_children = request.GET.get('include_children'); + include_children = request.GET.get('include_children') if include_children: if include_children.lower() == 'false': exclude_children = True