Skip to content

Commit

Permalink
OPEN-3126: Better handling of root URL views v2
Browse files Browse the repository at this point in the history
  • Loading branch information
thriuin committed Feb 9, 2024
1 parent d5ed68d commit 0905fec
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,13 +1050,10 @@ def get(self, request: HttpRequest):
else:
return redirect('/search/{0}/'.format(request.LANGUAGE_CODE) )
else:
if request.LANGUAGE_CODE == 'fr':
if settings.DEFAULT_SEARCH_TYPE:
return redirect(f'/rechercher/{settings.DEFAULT_SEARCH_TYPE}/')
else:
return redirect('/rechercher/')
if settings.DEFAULT_SEARCH_TYPE:
return redirect(f'/{settings.SEARCH_HOST_PATH}/{settings.DEFAULT_SEARCH_TYPE}/')
else:
if settings.DEFAULT_SEARCH_TYPE:
return redirect(f'/search/{settings.DEFAULT_SEARCH_TYPE}/')
if settings.SEARCH_HOST_PATH:
return redirect(f'/{settings.SEARCH_HOST_PATH}/')
else:
return redirect('/search/')
return redirect('/')

0 comments on commit 0905fec

Please sign in to comment.