From 200321e7a456e5521902eaa045a5bb86ec504956 Mon Sep 17 00:00:00 2001 From: Artem Kotik Date: Sun, 22 Oct 2023 14:25:14 +0400 Subject: [PATCH] Fix failing migrations on fresh database (#33) --- netbox_config_diff/views/configuration.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/netbox_config_diff/views/configuration.py b/netbox_config_diff/views/configuration.py index 70d86d9..ce8ba4f 100644 --- a/netbox_config_diff/views/configuration.py +++ b/netbox_config_diff/views/configuration.py @@ -6,7 +6,7 @@ from core.tables import JobTable from django.contrib import messages from django.contrib.auth.models import User -from django.contrib.contenttypes.models import ContentType +from django.db.models import Q from django.http import HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render from netbox.constants import RQ_QUEUE_DEFAULT @@ -300,9 +300,7 @@ def post(self, request, pk): class JobListView(generic.ObjectListView): - queryset = Job.objects.filter( - object_type=ContentType.objects.get(app_label="netbox_config_diff", model="configurationrequest") - ) + queryset = Job.objects.filter(Q(name__contains="push_configs") | Q(name__contains="collect_diffs")) filterset = JobFilterSet filterset_form = JobFilterForm table = JobTable