Book page fix
[wolnelektury.git] / src / redirects / views.py
1 from django.shortcuts import get_object_or_404
2 from django.views.generic.base import RedirectView
3 from . import models
4
5
6 class WLRedirectView(RedirectView):
7     permanent = False
8
9     def get_redirect_url(self, slug):
10         redirect = get_object_or_404(models.Redirect, slug=slug)
11         redirect.update_counter()
12         return redirect.url