Explorar el Código

Merge branch 'develop' into develop-2.6

John Anderson hace 7 años
padre
commit
11976f8968
Se han modificado 2 ficheros con 3 adiciones y 1 borrados
  1. 1 0
      CHANGELOG.md
  2. 2 1
      netbox/tenancy/filters.py

+ 1 - 0
CHANGELOG.md

@@ -33,6 +33,7 @@ v2.5.8 (FUTURE)
 * [#2923](https://github.com/digitalocean/netbox/issues/2923) - Provider filter form's site field should be blank by default
 * [#2938](https://github.com/digitalocean/netbox/issues/2938) - Enforce deterministic ordering of device components returned by API
 * [#2939](https://github.com/digitalocean/netbox/issues/2939) - Exclude circuit terminations from API interface connections endpoint
+* [#2952](https://github.com/digitalocean/netbox/issues/2952) - Added the `slug` field to the Tenant filter for use in the API and search function
 
 ---
 

+ 2 - 1
netbox/tenancy/filters.py

@@ -36,13 +36,14 @@ class TenantFilter(CustomFieldFilterSet, django_filters.FilterSet):
 
     class Meta:
         model = Tenant
-        fields = ['name']
+        fields = ['name', 'slug']
 
     def search(self, queryset, name, value):
         if not value.strip():
             return queryset
         return queryset.filter(
             Q(name__icontains=value) |
+            Q(slug__icontains=value) |
             Q(description__icontains=value) |
             Q(comments__icontains=value)
         )