[MISC] Fixed variable name typo of AdapterKeys.PLATFORM_PROVIDED_UNSTRUCT_KEY (#1559)

* misc: Fixed variable name typo and added gitignore entries

* Update .gitignore

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Chandrasekharan M
2025-10-01 17:25:23 +05:30
committed by GitHub
parent e37029b814
commit e2b72589bc
3 changed files with 14 additions and 4 deletions

8
.gitignore vendored
View File

@@ -625,9 +625,15 @@ backend/plugins/subscription/*
# API Deployment Plugins
backend/plugins/api/**
# Notfication plugins
# Notification Plugin
backend/plugins/notification/**
# Configuration Plugin
backend/plugins/configuration/**
# Verticals Usage Plugin
backend/plugins/verticals_usage/**
# BE pluggable-apps
backend/pluggable_apps/*

View File

@@ -123,7 +123,7 @@ class AdapterProcessor:
):
if (
adapter_metadata.get(
AdapterKeys.PLATFORM_PROVIDED_UNSTRUCT_KEY
AdapterKeys.PLATFORM_PROVIDED_UNSTRACT_KEY
)
and add_unstract_key
):
@@ -153,7 +153,7 @@ class AdapterProcessor:
if adapter_metadata.pop(AdapterKeys.ADAPTER_TYPE) == AdapterKeys.X2TEXT:
if (
adapter_metadata.get(AdapterKeys.PLATFORM_PROVIDED_UNSTRUCT_KEY)
adapter_metadata.get(AdapterKeys.PLATFORM_PROVIDED_UNSTRACT_KEY)
and add_unstract_key
):
adapter_metadata = add_unstract_key(adapter_metadata)

View File

@@ -1,6 +1,10 @@
import logging
from django.db import IntegrityError
from rest_framework.exceptions import ValidationError
logger = logging.getLogger(__name__)
class IntegrityErrorMixin:
"""Mixin to handle IntegrityError across multiple serializers for unique
@@ -30,7 +34,7 @@ class IntegrityErrorMixin:
field = field_error_message_map.get("field")
message = field_error_message_map.get("message")
raise ValidationError({field: message})
logger.exception("IntegrityError: %s", error)
# Default message if the error doesn't match any known unique constraints
raise ValidationError(
{"detail": "An error occurred while saving. Please try again."}