Skip to content

Commit

Permalink
Extra check with blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
JobDoesburg committed Dec 12, 2024
1 parent 4399ec6 commit 3cdb61b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/fridges/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down

0 comments on commit 3cdb61b

Please sign in to comment.