Case insensitive album slug
This commit is contained in:
parent
01dec1e140
commit
eeff75a3e9
1 changed files with 2 additions and 1 deletions
|
@ -53,7 +53,8 @@ class PhotoDetail(DetailView):
|
|||
def get_object(self, queryset=None):
|
||||
album_slug = self.kwargs.get('album_slug')
|
||||
photo_slug = self.kwargs.get('photo_slug')
|
||||
photo = get_object_or_404(Photo.objects.select_related('album'), slug=photo_slug, album__slug=album_slug)
|
||||
# photo = get_object_or_404(Photo.objects.select_related('album'), slug=photo_slug, album__slug=album_slug)
|
||||
photo = get_object_or_404(Photo.objects.select_related('album'), slug=photo_slug, album__slug__iexact=album_slug)
|
||||
|
||||
if photo.slug not in self.request.session:
|
||||
photo.add_view()
|
||||
|
|
Loading…
Add table
Reference in a new issue