From 0c9f7d3067317eec11b44f89b5e592c764cfbf47 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Sun, 4 Mar 2018 18:40:57 +0100 Subject: [PATCH] Avoid a crash when no photos are found for a flat --- flatisfy/models/flat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flatisfy/models/flat.py b/flatisfy/models/flat.py index 127b007..7e3c3c3 100644 --- a/flatisfy/models/flat.py +++ b/flatisfy/models/flat.py @@ -157,6 +157,8 @@ class Flat(BASE): """ Photos validation method """ + if not photos: + photos = [] for photo in photos: try: # Remove computed hash to avoid storing it in db