Features: 1) Add integration_path filter to active vendor query in get_vendors_integrations;
Fixes: 1) Ensure only vendors with a valid integration_path are included in the results; Extra: 1) Adjust query formatting for improved readability.
This commit is contained in:
parent
5b06f83cfc
commit
45d20bc17e
1 changed files with 12 additions and 1 deletions
|
|
@ -7,7 +7,18 @@ from evibes.utils.misc import create_object
|
||||||
|
|
||||||
def get_vendors_integrations(name: str | None = None) -> list[Type[AbstractVendor]]:
|
def get_vendors_integrations(name: str | None = None) -> list[Type[AbstractVendor]]:
|
||||||
vendors_integrations: list[Type[AbstractVendor]] = []
|
vendors_integrations: list[Type[AbstractVendor]] = []
|
||||||
vendors = Vendor.objects.filter(is_active=True, name=name) if name else Vendor.objects.filter(is_active=True)
|
vendors = (
|
||||||
|
Vendor.objects.filter(
|
||||||
|
is_active=True,
|
||||||
|
integration_path__isnull=False,
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
|
if name
|
||||||
|
else Vendor.objects.filter(
|
||||||
|
is_active=True,
|
||||||
|
integration_path__isnull=False,
|
||||||
|
)
|
||||||
|
)
|
||||||
for vendor in vendors:
|
for vendor in vendors:
|
||||||
if vendor.integration_path:
|
if vendor.integration_path:
|
||||||
module_name = ".".join(vendor.integration_path.split(".")[:-1])
|
module_name = ".".join(vendor.integration_path.split(".")[:-1])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue