<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
# from django.views.generic.base import TemplateView
from django.shortcuts import get_list_or_404, get_object_or_404
from django.views.generic import ListView, DetailView
from imager_images.models import Photo, Album
from braces.views import LoginRequiredMixin


class LibraryView(LoginRequiredMixin, ListView):
    context_object_name = 'media'
    template_name = 'imager_images/library.html'

    def get_queryset(self):
        albums = get_list_or_404(Album, user=self.request.user)
        photos = get_list_or_404(Photo, user=self.request.user)
        return [albums, photos]


class AlbumView(LoginRequiredMixin, ListView):
    context_object_name = 'photos'
    template_name = 'imager_images/album.html'<commit_msg>Fixed 404 bug<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
# from django.views.generic.base import TemplateView
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from imager_images.models import Photo, Album
from braces.views import LoginRequiredMixin


class LibraryView(LoginRequiredMixin, ListView):
    context_object_name = 'media'
    template_name = 'imager_images/library.html'

    def get_queryset(self):
        albums = self.request.user.albums.all()
        photos = self.request.user.photos.all()
        return [albums, photos]


class AlbumView(LoginRequiredMixin, ListView):
    context_object_name = 'photos'
    template_name = 'imager_images/album.html'
{'fraction_non_alphanumeric': 0.09023024268823895, 'fraction_numerical': 0.012445550715619166, 'mean_word_length': 4.702127659574468, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1059130', 'n_tokens_mistral': 515, 'n_tokens_neox': 487, 'n_words': 110}