X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c6eaa20b4ddb98a2d085bb588224c36115334c52..6e102eb7360b2c7df5a8565486e3428e6ccf2ab8:/apps/catalogue/views.py diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 7f1de6d46..84cce7b2c 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -15,7 +15,7 @@ from datetime import datetime from django.conf import settings from django.template import RequestContext from django.shortcuts import render_to_response, get_object_or_404 -from django.http import HttpResponse, HttpResponseRedirect, Http404 +from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponsePermanentRedirect from django.core.urlresolvers import reverse from django.db.models import Q from django.contrib.auth.decorators import login_required, user_passes_test @@ -152,6 +152,8 @@ def tagged_object_list(request, tags=''): raise Http404 except models.Tag.MultipleObjectsReturned, e: return differentiate_tags(request, e.tags, e.ambiguous_slugs) + except models.Tag.UrlDeprecationWarning, e: + return HttpResponsePermanentRedirect(reverse('tagged_object_list', args=['/'.join(tag.url_chunk for tag in e.tags)])) try: if len(tags) > settings.MAX_TAG_LIST: