Skip to content

Commit

Permalink
fixed sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jagadeeswaran-zipstack committed Jan 13, 2025
1 parent 9ca8366 commit 0ed5d94
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@


def migrate_adapter_data(apps, schema_editor):
AdapterInstance = apps.get_model("adapter_processor_v2", "AdapterInstance")
adapter_instance = apps.get_model("adapter_processor_v2", "AdapterInstance")

old_adapter_id = "llmwhisperer|0a1647f0-f65f-410d-843b-3d979c78350e"
new_adapter_id = "llmwhisperer|a5e6b8af-3e1f-4a80-b006-d017e8e67f93"

for adapter in AdapterInstance.objects.all():
for adapter in adapter_instance.objects.all():

# Deserialize adapter_metadata_b if it exists
encryption_secret: str = settings.ENCRYPTION_KEY
Expand Down Expand Up @@ -44,14 +44,14 @@ def migrate_adapter_data(apps, schema_editor):


def rollback_adapter_data(apps, schema_editor):
AdapterInstance = apps.get_model("adapter_processor_v2", "AdapterInstance")
adapter_instance = apps.get_model("adapter_processor_v2", "AdapterInstance")

old_adapter_id = "llmwhisperer|0a1647f0-f65f-410d-843b-3d979c78350e"

encryption_secret: str = settings.ENCRYPTION_KEY
f: Fernet = Fernet(encryption_secret.encode("utf-8"))

for adapter in AdapterInstance.objects.all():
for adapter in adapter_instance.objects.all():
if adapter.adapter_metadata_b:
# Deserialize adapter_metadata_b
metadata = json.loads(
Expand Down

0 comments on commit 0ed5d94

Please sign in to comment.