Commit 704027af by Bach Dániel

firewall: fix TypeError in add_blacklist_item()

parent 9a6884bf
...@@ -87,8 +87,9 @@ def add_blacklist_item(request): ...@@ -87,8 +87,9 @@ def add_blacklist_item(request):
pass pass
now = timezone.now() now = timezone.now()
can_update = ((obj.whitelisted and now > obj.expires_at) or can_update = (
not obj.whitelisted) (obj.whitelisted and obj.expires_at and now > obj.expires_at) or
not obj.whitelisted)
is_new = created or (obj.expires_at and now > obj.expires_at) is_new = created or (obj.expires_at and now > obj.expires_at)
if created or can_update: if created or can_update:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment