Skip to content

Commit

Permalink
Merge pull request PGScatalog#353 from ens-lgil/feature/new_browse_sc…
Browse files Browse the repository at this point in the history
…ores_page_2

Fix CSRF issue with the Browse Publications page
  • Loading branch information
fyvon authored Apr 19, 2024
2 parents e910f7b + a12e43a commit 1f261e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion catalog/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
6 changes: 3 additions & 3 deletions catalog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1f261e2

Please sign in to comment.