Skip to content

Commit

Permalink
Merge pull request #102 from allink/amal/feat/legacy-redirect-last-ch…
Browse files Browse the repository at this point in the history
…ar-adjustment

legacy redirect: removed the deletion of the last character as it led…
  • Loading branch information
Cut3cumber authored Aug 17, 2020
2 parents 63adda1 + a1e8d8a commit 122658e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ new features or plugins
#### FIXES
general bugfixes

## v2.6.3
#### FIXES
- removed Query filter from legacy redirect that removed the last character as it led to multiple matches

## v2.6.2
#### FIXES
Expand Down
2 changes: 1 addition & 1 deletion allink_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

__version__ = '2.6.2'
__version__ = '2.6.3'

# Cheeky setting that allows each template to be accessible by two paths.
# Eg: the template 'allink/templates/allink/base.html' can be accessed via both
Expand Down
2 changes: 1 addition & 1 deletion allink_core/core_apps/allink_legacy_redirect/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __call__(self, request): # noqa TODO this needs to be refactored anyway, so
link = None
try:
link = AllinkLegacyLink.objects.get(Q(old=request.path) | Q(
old=request.path + '/') | Q(old=request.path[:-1]) | Q(old=request.get_full_path()), active=True)
old=request.path + '/') | Q(old=request.get_full_path()), active=True)

# if user is logged in, skip redirect
if link.redirect_when_logged_out and request.user.is_authenticated:
Expand Down

0 comments on commit 122658e

Please sign in to comment.