feat: add parser source dashboard and scheduling
All checks were successful
CI/CD Pipeline / Code Quality Checks (pull_request) Successful in 1m55s
CI/CD Pipeline / Run Tests (pull_request) Successful in 3m6s
CI/CD Pipeline / Run API Inventory E2E Tests (pull_request) Successful in 2m48s
CI/CD Pipeline / Telegram Notify Success (pull_request) Successful in 19s
All checks were successful
CI/CD Pipeline / Code Quality Checks (pull_request) Successful in 1m55s
CI/CD Pipeline / Run Tests (pull_request) Successful in 3m6s
CI/CD Pipeline / Run API Inventory E2E Tests (pull_request) Successful in 2m48s
CI/CD Pipeline / Telegram Notify Success (pull_request) Successful in 19s
This commit is contained in:
@@ -8,6 +8,7 @@ They are easily testable and can manage transactions.
|
||||
import logging
|
||||
from typing import Any, Generic, TypeVar
|
||||
|
||||
import django
|
||||
from apps.core.exceptions import NotFoundError
|
||||
from django.db import models, transaction
|
||||
from django.db.models import QuerySet
|
||||
@@ -272,8 +273,13 @@ class BulkOperationsMixin:
|
||||
"ignore_conflicts": ignore_conflicts,
|
||||
}
|
||||
|
||||
# Django 4.1+ поддерживает update_conflicts
|
||||
if update_conflicts and update_fields and unique_fields:
|
||||
# Django 4.1+ поддерживает update_conflicts; проект закреплён на Django 3.x.
|
||||
if (
|
||||
django.VERSION >= (4, 1)
|
||||
and update_conflicts
|
||||
and update_fields
|
||||
and unique_fields
|
||||
):
|
||||
kwargs["update_conflicts"] = True
|
||||
kwargs["update_fields"] = update_fields
|
||||
kwargs["unique_fields"] = unique_fields
|
||||
|
||||
Reference in New Issue
Block a user