We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Downloading albums fills up the disk
### Describe the bug
When a user wants to download an album, the website creates a zip file containing all photos (in `/tmp` of the Docker container). If multiple albums are downloaded, multiple large zip files are created. This very quickly fills up the disk.

We should remove this functionality to prevent this. It is not used often so that should not be a problem for members.

### Additional context
This has caused website outages a few times in the past.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `website/photos/views.py`
Content:
```
1 import os
2 from tempfile import gettempdir
3 from zipfile import ZipFile
4 
5 from django.contrib.auth.decorators import login_required
6 from django.core.paginator import EmptyPage, Paginator
7 from django.http import Http404
8 from django.shortcuts import get_object_or_404, render
9 from django.utils.translation import get_language
10 from django_sendfile import sendfile
11 
12 from photos.models import Album, Photo
13 from photos.services import (
14     check_shared_album_token,
15     get_annotated_accessible_albums,
16     is_album_accessible,
17 )
18 
19 COVER_FILENAME = "cover.jpg"
20 
21 
22 @login_required
23 def index(request):
24     """Render the index page showing multiple album cards."""
25     keywords = request.GET.get("keywords", "").split()
26 
27     # Only show published albums
28     albums = Album.objects.filter(hidden=False)
29     for key in keywords:
30         albums = albums.filter(**{f"title_{get_language()}__icontains": key})
31 
32     albums = get_annotated_accessible_albums(request, albums)
33 
34     albums = albums.order_by("-date")
35     paginator = Paginator(albums, 16)
36 
37     page = request.GET.get("page")
38     page = 1 if page is None or not page.isdigit() else int(page)
39     try:
40         albums = paginator.page(page)
41     except EmptyPage:
42         # If page is out of range (e.g. 9999), deliver last page of results.
43         albums = paginator.page(paginator.num_pages)
44         page = paginator.num_pages
45 
46     # Show the two pages before and after the current page
47     page_range_start = max(1, page - 2)
48     page_range_stop = min(page + 3, paginator.num_pages + 1)
49 
50     # Add extra pages if we show less than 5 pages
51     page_range_start = min(page_range_start, page_range_stop - 5)
52     page_range_start = max(1, page_range_start)
53 
54     # Add extra pages if we still show less than 5 pages
55     page_range_stop = max(page_range_stop, page_range_start + 5)
56     page_range_stop = min(page_range_stop, paginator.num_pages + 1)
57 
58     page_range = range(page_range_start, page_range_stop)
59 
60     return render(
61         request,
62         "photos/index.html",
63         {"albums": albums, "page_range": page_range, "keywords": keywords},
64     )
65 
66 
67 def _render_album_page(request, album):
68     """Render album.html for a specified album."""
69     context = {"album": album, "photos": album.photo_set.filter(hidden=False)}
70     return render(request, "photos/album.html", context)
71 
72 
73 @login_required
74 def detail(request, slug):
75     """Render an album, if it accessible by the user."""
76     obj = get_object_or_404(Album, slug=slug)
77     if is_album_accessible(request, obj):
78         return _render_album_page(request, obj)
79     raise Http404("Sorry, you're not allowed to view this album")
80 
81 
82 def shared_album(request, slug, token):
83     """Render a shared album if the correct token is provided."""
84     obj = get_object_or_404(Album, slug=slug)
85     check_shared_album_token(obj, token)
86     return _render_album_page(request, obj)
87 
88 
89 def _photo_path(obj, filename):
90     """Return the path to a Photo."""
91     photoname = os.path.basename(filename)
92     albumpath = os.path.join(obj.photosdir, obj.dirname)
93     photopath = os.path.join(albumpath, photoname)
94     get_object_or_404(Photo.objects.filter(album=obj, file=photopath))
95     return photopath
96 
97 
98 def _download(request, obj, filename):
99     """Download a photo.
100 
101     This function provides a layer of indirection for shared albums.
102     """
103     photopath = _photo_path(obj, filename)
104     photo = get_object_or_404(Photo.objects.filter(album=obj, file=photopath))
105     return sendfile(request, photo.file.path, attachment=True)
106 
107 
108 def _album_download(request, obj):
109     """Download an album.
110 
111     This function provides a layer of indirection for shared albums.
112     """
113     albumpath = os.path.join(obj.photospath, obj.dirname)
114     zipfilename = os.path.join(gettempdir(), "{}.zip".format(obj.dirname))
115     if not os.path.exists(zipfilename):
116         with ZipFile(zipfilename, "w") as f:
117             pictures = [os.path.join(albumpath, x) for x in os.listdir(albumpath)]
118             for picture in pictures:
119                 f.write(picture, arcname=os.path.basename(picture))
120     return sendfile(request, zipfilename, attachment=True)
121 
122 
123 @login_required
124 def download(request, slug, filename):
125     """Download a photo if the album of the photo is accessible by the user."""
126     obj = get_object_or_404(Album, slug=slug)
127     if is_album_accessible(request, obj):
128         return _download(request, obj, filename)
129     raise Http404("Sorry, you're not allowed to view this album")
130 
131 
132 @login_required
133 def album_download(request, slug):
134     """Download an album if the album is accessible by the user."""
135     obj = get_object_or_404(Album, slug=slug)
136     if is_album_accessible(request, obj):
137         return _album_download(request, obj)
138     raise Http404("Sorry, you're not allowed to view this album")
139 
140 
141 def shared_download(request, slug, token, filename):
142     """Download a photo from a shared album if the album token is provided."""
143     obj = get_object_or_404(Album, slug=slug)
144     check_shared_album_token(obj, token)
145     return _download(request, obj, filename)
146 
147 
148 def shared_album_download(request, slug, token):
149     """Download a shared album if the album token is provided."""
150     obj = get_object_or_404(Album, slug=slug)
151     check_shared_album_token(obj, token)
152     return _album_download(request, obj)
153
```

Path: `website/photos/urls.py`
Content:
```
1 from django.urls import path, include
2 
3 from . import views
4 
5 app_name = "photos"
6 
7 urlpatterns = [
8     path(
9         "members/photos/",
10         include(
11             [
12                 path("", views.index, name="index"),
13                 path(
14                     "<slug>/",
15                     include(
16                         [
17                             path("", views.detail, name="album"),
18                             path(
19                                 "download/",
20                                 include(
21                                     [
22                                         path(
23                                             "",
24                                             views.album_download,
25                                             name="album-download",
26                                         ),
27                                         path(
28                                             "<filename>",
29                                             views.download,
30                                             name="download",
31                                         ),
32                                         path(
33                                             "<token>/",
34                                             include(
35                                                 [
36                                                     path(
37                                                         "",
38                                                         views.shared_album_download,
39                                                         name="shared-album-download",
40                                                     ),
41                                                     path(
42                                                         "<filename>",
43                                                         views.shared_download,
44                                                         name="shared-download",
45                                                     ),
46                                                 ]
47                                             ),
48                                         ),
49                                     ]
50                                 ),
51                             ),
52                             path("<token>/", views.shared_album, name="shared-album"),
53                         ]
54                     ),
55                 ),
56             ]
57         ),
58     )
59 ]
60
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/website/photos/urls.py b/website/photos/urls.py
--- a/website/photos/urls.py
+++ b/website/photos/urls.py
@@ -19,11 +19,6 @@
                                 "download/",
                                 include(
                                     [
-                                        path(
-                                            "",
-                                            views.album_download,
-                                            name="album-download",
-                                        ),
                                         path(
                                             "<filename>",
                                             views.download,
@@ -33,11 +28,6 @@
                                             "<token>/",
                                             include(
                                                 [
-                                                    path(
-                                                        "",
-                                                        views.shared_album_download,
-                                                        name="shared-album-download",
-                                                    ),
                                                     path(
                                                         "<filename>",
                                                         views.shared_download,
diff --git a/website/photos/views.py b/website/photos/views.py
--- a/website/photos/views.py
+++ b/website/photos/views.py
@@ -1,6 +1,4 @@
 import os
-from tempfile import gettempdir
-from zipfile import ZipFile
 
 from django.contrib.auth.decorators import login_required
 from django.core.paginator import EmptyPage, Paginator
@@ -105,21 +103,6 @@
     return sendfile(request, photo.file.path, attachment=True)
 
 
-def _album_download(request, obj):
-    """Download an album.
-
-    This function provides a layer of indirection for shared albums.
-    """
-    albumpath = os.path.join(obj.photospath, obj.dirname)
-    zipfilename = os.path.join(gettempdir(), "{}.zip".format(obj.dirname))
-    if not os.path.exists(zipfilename):
-        with ZipFile(zipfilename, "w") as f:
-            pictures = [os.path.join(albumpath, x) for x in os.listdir(albumpath)]
-            for picture in pictures:
-                f.write(picture, arcname=os.path.basename(picture))
-    return sendfile(request, zipfilename, attachment=True)
-
-
 @login_required
 def download(request, slug, filename):
     """Download a photo if the album of the photo is accessible by the user."""
@@ -129,24 +112,8 @@
     raise Http404("Sorry, you're not allowed to view this album")
 
 
-@login_required
-def album_download(request, slug):
-    """Download an album if the album is accessible by the user."""
-    obj = get_object_or_404(Album, slug=slug)
-    if is_album_accessible(request, obj):
-        return _album_download(request, obj)
-    raise Http404("Sorry, you're not allowed to view this album")
-
-
 def shared_download(request, slug, token, filename):
     """Download a photo from a shared album if the album token is provided."""
     obj = get_object_or_404(Album, slug=slug)
     check_shared_album_token(obj, token)
     return _download(request, obj, filename)
-
-
-def shared_album_download(request, slug, token):
-    """Download a shared album if the album token is provided."""
-    obj = get_object_or_404(Album, slug=slug)
-    check_shared_album_token(obj, token)
-    return _album_download(request, obj)

{"golden_diff": "diff --git a/website/photos/urls.py b/website/photos/urls.py\n--- a/website/photos/urls.py\n+++ b/website/photos/urls.py\n@@ -19,11 +19,6 @@\n                                 \"download/\",\n                                 include(\n                                     [\n-                                        path(\n-                                            \"\",\n-                                            views.album_download,\n-                                            name=\"album-download\",\n-                                        ),\n                                         path(\n                                             \"<filename>\",\n                                             views.download,\n@@ -33,11 +28,6 @@\n                                             \"<token>/\",\n                                             include(\n                                                 [\n-                                                    path(\n-                                                        \"\",\n-                                                        views.shared_album_download,\n-                                                        name=\"shared-album-download\",\n-                                                    ),\n                                                     path(\n                                                         \"<filename>\",\n                                                         views.shared_download,\ndiff --git a/website/photos/views.py b/website/photos/views.py\n--- a/website/photos/views.py\n+++ b/website/photos/views.py\n@@ -1,6 +1,4 @@\n import os\n-from tempfile import gettempdir\n-from zipfile import ZipFile\n \n from django.contrib.auth.decorators import login_required\n from django.core.paginator import EmptyPage, Paginator\n@@ -105,21 +103,6 @@\n     return sendfile(request, photo.file.path, attachment=True)\n \n \n-def _album_download(request, obj):\n-    \"\"\"Download an album.\n-\n-    This function provides a layer of indirection for shared albums.\n-    \"\"\"\n-    albumpath = os.path.join(obj.photospath, obj.dirname)\n-    zipfilename = os.path.join(gettempdir(), \"{}.zip\".format(obj.dirname))\n-    if not os.path.exists(zipfilename):\n-        with ZipFile(zipfilename, \"w\") as f:\n-            pictures = [os.path.join(albumpath, x) for x in os.listdir(albumpath)]\n-            for picture in pictures:\n-                f.write(picture, arcname=os.path.basename(picture))\n-    return sendfile(request, zipfilename, attachment=True)\n-\n-\n @login_required\n def download(request, slug, filename):\n     \"\"\"Download a photo if the album of the photo is accessible by the user.\"\"\"\n@@ -129,24 +112,8 @@\n     raise Http404(\"Sorry, you're not allowed to view this album\")\n \n \n-@login_required\n-def album_download(request, slug):\n-    \"\"\"Download an album if the album is accessible by the user.\"\"\"\n-    obj = get_object_or_404(Album, slug=slug)\n-    if is_album_accessible(request, obj):\n-        return _album_download(request, obj)\n-    raise Http404(\"Sorry, you're not allowed to view this album\")\n-\n-\n def shared_download(request, slug, token, filename):\n     \"\"\"Download a photo from a shared album if the album token is provided.\"\"\"\n     obj = get_object_or_404(Album, slug=slug)\n     check_shared_album_token(obj, token)\n     return _download(request, obj, filename)\n-\n-\n-def shared_album_download(request, slug, token):\n-    \"\"\"Download a shared album if the album token is provided.\"\"\"\n-    obj = get_object_or_404(Album, slug=slug)\n-    check_shared_album_token(obj, token)\n-    return _album_download(request, obj)\n", "issue": "Downloading albums fills up the disk\n### Describe the bug\r\nWhen a user wants to download an album, the website creates a zip file containing all photos (in `/tmp` of the Docker container). If multiple albums are downloaded, multiple large zip files are created. This very quickly fills up the disk.\r\n\r\nWe should remove this functionality to prevent this. It is not used often so that should not be a problem for members.\r\n\r\n### Additional context\r\nThis has caused website outages a few times in the past.\r\n\n", "before_files": [{"content": "import os\nfrom tempfile import gettempdir\nfrom zipfile import ZipFile\n\nfrom django.contrib.auth.decorators import login_required\nfrom django.core.paginator import EmptyPage, Paginator\nfrom django.http import Http404\nfrom django.shortcuts import get_object_or_404, render\nfrom django.utils.translation import get_language\nfrom django_sendfile import sendfile\n\nfrom photos.models import Album, Photo\nfrom photos.services import (\n    check_shared_album_token,\n    get_annotated_accessible_albums,\n    is_album_accessible,\n)\n\nCOVER_FILENAME = \"cover.jpg\"\n\n\n@login_required\ndef index(request):\n    \"\"\"Render the index page showing multiple album cards.\"\"\"\n    keywords = request.GET.get(\"keywords\", \"\").split()\n\n    # Only show published albums\n    albums = Album.objects.filter(hidden=False)\n    for key in keywords:\n        albums = albums.filter(**{f\"title_{get_language()}__icontains\": key})\n\n    albums = get_annotated_accessible_albums(request, albums)\n\n    albums = albums.order_by(\"-date\")\n    paginator = Paginator(albums, 16)\n\n    page = request.GET.get(\"page\")\n    page = 1 if page is None or not page.isdigit() else int(page)\n    try:\n        albums = paginator.page(page)\n    except EmptyPage:\n        # If page is out of range (e.g. 9999), deliver last page of results.\n        albums = paginator.page(paginator.num_pages)\n        page = paginator.num_pages\n\n    # Show the two pages before and after the current page\n    page_range_start = max(1, page - 2)\n    page_range_stop = min(page + 3, paginator.num_pages + 1)\n\n    # Add extra pages if we show less than 5 pages\n    page_range_start = min(page_range_start, page_range_stop - 5)\n    page_range_start = max(1, page_range_start)\n\n    # Add extra pages if we still show less than 5 pages\n    page_range_stop = max(page_range_stop, page_range_start + 5)\n    page_range_stop = min(page_range_stop, paginator.num_pages + 1)\n\n    page_range = range(page_range_start, page_range_stop)\n\n    return render(\n        request,\n        \"photos/index.html\",\n        {\"albums\": albums, \"page_range\": page_range, \"keywords\": keywords},\n    )\n\n\ndef _render_album_page(request, album):\n    \"\"\"Render album.html for a specified album.\"\"\"\n    context = {\"album\": album, \"photos\": album.photo_set.filter(hidden=False)}\n    return render(request, \"photos/album.html\", context)\n\n\n@login_required\ndef detail(request, slug):\n    \"\"\"Render an album, if it accessible by the user.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    if is_album_accessible(request, obj):\n        return _render_album_page(request, obj)\n    raise Http404(\"Sorry, you're not allowed to view this album\")\n\n\ndef shared_album(request, slug, token):\n    \"\"\"Render a shared album if the correct token is provided.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    check_shared_album_token(obj, token)\n    return _render_album_page(request, obj)\n\n\ndef _photo_path(obj, filename):\n    \"\"\"Return the path to a Photo.\"\"\"\n    photoname = os.path.basename(filename)\n    albumpath = os.path.join(obj.photosdir, obj.dirname)\n    photopath = os.path.join(albumpath, photoname)\n    get_object_or_404(Photo.objects.filter(album=obj, file=photopath))\n    return photopath\n\n\ndef _download(request, obj, filename):\n    \"\"\"Download a photo.\n\n    This function provides a layer of indirection for shared albums.\n    \"\"\"\n    photopath = _photo_path(obj, filename)\n    photo = get_object_or_404(Photo.objects.filter(album=obj, file=photopath))\n    return sendfile(request, photo.file.path, attachment=True)\n\n\ndef _album_download(request, obj):\n    \"\"\"Download an album.\n\n    This function provides a layer of indirection for shared albums.\n    \"\"\"\n    albumpath = os.path.join(obj.photospath, obj.dirname)\n    zipfilename = os.path.join(gettempdir(), \"{}.zip\".format(obj.dirname))\n    if not os.path.exists(zipfilename):\n        with ZipFile(zipfilename, \"w\") as f:\n            pictures = [os.path.join(albumpath, x) for x in os.listdir(albumpath)]\n            for picture in pictures:\n                f.write(picture, arcname=os.path.basename(picture))\n    return sendfile(request, zipfilename, attachment=True)\n\n\n@login_required\ndef download(request, slug, filename):\n    \"\"\"Download a photo if the album of the photo is accessible by the user.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    if is_album_accessible(request, obj):\n        return _download(request, obj, filename)\n    raise Http404(\"Sorry, you're not allowed to view this album\")\n\n\n@login_required\ndef album_download(request, slug):\n    \"\"\"Download an album if the album is accessible by the user.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    if is_album_accessible(request, obj):\n        return _album_download(request, obj)\n    raise Http404(\"Sorry, you're not allowed to view this album\")\n\n\ndef shared_download(request, slug, token, filename):\n    \"\"\"Download a photo from a shared album if the album token is provided.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    check_shared_album_token(obj, token)\n    return _download(request, obj, filename)\n\n\ndef shared_album_download(request, slug, token):\n    \"\"\"Download a shared album if the album token is provided.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    check_shared_album_token(obj, token)\n    return _album_download(request, obj)\n", "path": "website/photos/views.py"}, {"content": "from django.urls import path, include\n\nfrom . import views\n\napp_name = \"photos\"\n\nurlpatterns = [\n    path(\n        \"members/photos/\",\n        include(\n            [\n                path(\"\", views.index, name=\"index\"),\n                path(\n                    \"<slug>/\",\n                    include(\n                        [\n                            path(\"\", views.detail, name=\"album\"),\n                            path(\n                                \"download/\",\n                                include(\n                                    [\n                                        path(\n                                            \"\",\n                                            views.album_download,\n                                            name=\"album-download\",\n                                        ),\n                                        path(\n                                            \"<filename>\",\n                                            views.download,\n                                            name=\"download\",\n                                        ),\n                                        path(\n                                            \"<token>/\",\n                                            include(\n                                                [\n                                                    path(\n                                                        \"\",\n                                                        views.shared_album_download,\n                                                        name=\"shared-album-download\",\n                                                    ),\n                                                    path(\n                                                        \"<filename>\",\n                                                        views.shared_download,\n                                                        name=\"shared-download\",\n                                                    ),\n                                                ]\n                                            ),\n                                        ),\n                                    ]\n                                ),\n                            ),\n                            path(\"<token>/\", views.shared_album, name=\"shared-album\"),\n                        ]\n                    ),\n                ),\n            ]\n        ),\n    )\n]\n", "path": "website/photos/urls.py"}], "after_files": [{"content": "import os\n\nfrom django.contrib.auth.decorators import login_required\nfrom django.core.paginator import EmptyPage, Paginator\nfrom django.http import Http404\nfrom django.shortcuts import get_object_or_404, render\nfrom django.utils.translation import get_language\nfrom django_sendfile import sendfile\n\nfrom photos.models import Album, Photo\nfrom photos.services import (\n    check_shared_album_token,\n    get_annotated_accessible_albums,\n    is_album_accessible,\n)\n\nCOVER_FILENAME = \"cover.jpg\"\n\n\n@login_required\ndef index(request):\n    \"\"\"Render the index page showing multiple album cards.\"\"\"\n    keywords = request.GET.get(\"keywords\", \"\").split()\n\n    # Only show published albums\n    albums = Album.objects.filter(hidden=False)\n    for key in keywords:\n        albums = albums.filter(**{f\"title_{get_language()}__icontains\": key})\n\n    albums = get_annotated_accessible_albums(request, albums)\n\n    albums = albums.order_by(\"-date\")\n    paginator = Paginator(albums, 16)\n\n    page = request.GET.get(\"page\")\n    page = 1 if page is None or not page.isdigit() else int(page)\n    try:\n        albums = paginator.page(page)\n    except EmptyPage:\n        # If page is out of range (e.g. 9999), deliver last page of results.\n        albums = paginator.page(paginator.num_pages)\n        page = paginator.num_pages\n\n    # Show the two pages before and after the current page\n    page_range_start = max(1, page - 2)\n    page_range_stop = min(page + 3, paginator.num_pages + 1)\n\n    # Add extra pages if we show less than 5 pages\n    page_range_start = min(page_range_start, page_range_stop - 5)\n    page_range_start = max(1, page_range_start)\n\n    # Add extra pages if we still show less than 5 pages\n    page_range_stop = max(page_range_stop, page_range_start + 5)\n    page_range_stop = min(page_range_stop, paginator.num_pages + 1)\n\n    page_range = range(page_range_start, page_range_stop)\n\n    return render(\n        request,\n        \"photos/index.html\",\n        {\"albums\": albums, \"page_range\": page_range, \"keywords\": keywords},\n    )\n\n\ndef _render_album_page(request, album):\n    \"\"\"Render album.html for a specified album.\"\"\"\n    context = {\"album\": album, \"photos\": album.photo_set.filter(hidden=False)}\n    return render(request, \"photos/album.html\", context)\n\n\n@login_required\ndef detail(request, slug):\n    \"\"\"Render an album, if it accessible by the user.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    if is_album_accessible(request, obj):\n        return _render_album_page(request, obj)\n    raise Http404(\"Sorry, you're not allowed to view this album\")\n\n\ndef shared_album(request, slug, token):\n    \"\"\"Render a shared album if the correct token is provided.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    check_shared_album_token(obj, token)\n    return _render_album_page(request, obj)\n\n\ndef _photo_path(obj, filename):\n    \"\"\"Return the path to a Photo.\"\"\"\n    photoname = os.path.basename(filename)\n    albumpath = os.path.join(obj.photosdir, obj.dirname)\n    photopath = os.path.join(albumpath, photoname)\n    get_object_or_404(Photo.objects.filter(album=obj, file=photopath))\n    return photopath\n\n\ndef _download(request, obj, filename):\n    \"\"\"Download a photo.\n\n    This function provides a layer of indirection for shared albums.\n    \"\"\"\n    photopath = _photo_path(obj, filename)\n    photo = get_object_or_404(Photo.objects.filter(album=obj, file=photopath))\n    return sendfile(request, photo.file.path, attachment=True)\n\n\n@login_required\ndef download(request, slug, filename):\n    \"\"\"Download a photo if the album of the photo is accessible by the user.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    if is_album_accessible(request, obj):\n        return _download(request, obj, filename)\n    raise Http404(\"Sorry, you're not allowed to view this album\")\n\n\ndef shared_download(request, slug, token, filename):\n    \"\"\"Download a photo from a shared album if the album token is provided.\"\"\"\n    obj = get_object_or_404(Album, slug=slug)\n    check_shared_album_token(obj, token)\n    return _download(request, obj, filename)\n", "path": "website/photos/views.py"}, {"content": "from django.urls import path, include\n\nfrom . import views\n\napp_name = \"photos\"\n\nurlpatterns = [\n    path(\n        \"members/photos/\",\n        include(\n            [\n                path(\"\", views.index, name=\"index\"),\n                path(\n                    \"<slug>/\",\n                    include(\n                        [\n                            path(\"\", views.detail, name=\"album\"),\n                            path(\n                                \"download/\",\n                                include(\n                                    [\n                                        path(\n                                            \"<filename>\",\n                                            views.download,\n                                            name=\"download\",\n                                        ),\n                                        path(\n                                            \"<token>/\",\n                                            include(\n                                                [\n                                                    path(\n                                                        \"<filename>\",\n                                                        views.shared_download,\n                                                        name=\"shared-download\",\n                                                    ),\n                                                ]\n                                            ),\n                                        ),\n                                    ]\n                                ),\n                            ),\n                            path(\"<token>/\", views.shared_album, name=\"shared-album\"),\n                        ]\n                    ),\n                ),\n            ]\n        ),\n    )\n]\n", "path": "website/photos/urls.py"}]}