From d95f29c870f1c257386258f5606ddd03433c2770 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 15 Oct 2021 09:21:14 +0200 Subject: [PATCH] Do not crash on missing owner --- photologue_custom/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photologue_custom/views.py b/photologue_custom/views.py index c12d0a1..49301ff 100644 --- a/photologue_custom/views.py +++ b/photologue_custom/views.py @@ -58,7 +58,7 @@ class CustomGalleryDetailView(DetailView): # List owners context['owners'] = [] for photo in context['photos']: - if photo.extended.owner not in context['owners']: + if hasattr(photo, 'extended') and photo.extended.owner not in context['owners']: context['owners'].append(photo.extended.owner) # Filter on owner