From 2a219eff23332bd9e4429340033f10e32cb7bd07 Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Thu, 2 Jan 2020 16:13:47 +0000 Subject: [PATCH] `is not None` not needed as the value 'false' is a string --- netbox/ipam/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 24d8efa82..590b63703 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -335,7 +335,7 @@ class AggregateView(PermissionRequiredMixin, View): ) # Update the ipam_show_available cookie if request specifies it - if request.GET.get('show_available') is not None: + if request.GET.get('show_available'): request.session['ipam_show_available'] = request.GET.get('show_available') == 'true' # Add available prefixes to the table if the cookie requested it @@ -520,7 +520,7 @@ class PrefixPrefixesView(PermissionRequiredMixin, View): ).annotate_depth(limit=0) # Update the ipam_show_available cookie if request specifies it - if request.GET.get('show_available') is not None: + if request.GET.get('show_available'): request.session['ipam_show_available'] = request.GET.get('show_available') == 'true' # Add available prefixes to the table if the cookie requested it @@ -568,7 +568,7 @@ class PrefixIPAddressesView(PermissionRequiredMixin, View): ) # Update the ipam_show_available cookie if request specifies it - if request.GET.get('show_available') is not None: + if request.GET.get('show_available'): request.session['ipam_show_available'] = request.GET.get('show_available') == 'true' # Add available IP addresses to the table if the cookie requested it