From 3cdb61b76a8ba2375723ce4b67b9b0c0609bd2fb Mon Sep 17 00:00:00 2001 From: Job Doesburg Date: Thu, 12 Dec 2024 19:16:38 +0100 Subject: [PATCH] Extra check with blacklist --- website/fridges/services.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/fridges/services.py b/website/fridges/services.py index a7da3fb4..a17f3d39 100644 --- a/website/fridges/services.py +++ b/website/fridges/services.py @@ -8,6 +8,8 @@ def user_is_blacklisted(user, fridge): """Return whether a user is blacklisted from opening a fridge.""" + if not hasattr(fridge, "blacklist"): + return False return fridge.blacklist.filter(user=user).exists()