Skip to content

Commit

Permalink
Disable opening hidden/processing albums (#3671)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeD1rk authored Apr 26, 2024
1 parent 246cbc4 commit e6406a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions website/photos/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class AlbumDetailView(LoginRequiredMixin, _BaseAlbumView):

def get_album(self, **kwargs):
slug = kwargs.get("slug")
album = get_object_or_404(Album, slug=slug)
album = get_object_or_404(
Album.objects.filter(hidden=False, is_processing=False), slug=slug
)

if not is_album_accessible(self.request, album):
raise Http404("Sorry, you're not allowed to view this album")
Expand All @@ -91,7 +93,9 @@ class SharedAlbumView(_BaseAlbumView):
def get_album(self, **kwargs):
slug = kwargs.get("slug")
token = kwargs.get("token")
album = get_object_or_404(Album, slug=slug)
album = get_object_or_404(
Album.objects.filter(hidden=False, is_processing=False), slug=slug
)

check_shared_album_token(album, token)

Expand Down

0 comments on commit e6406a4

Please sign in to comment.