Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

[FIX] Mark server-managed organization field non-editable (DRF 3.15 compat) (#2092)

Chandrasekharan M64b06a7e1e10
diff --git a/backend/account_v2/migrations/0005_alter_platformkey_organization.py b/backend/account_v2/migrations/0005_alter_platformkey_organization.py
new file mode 100644
index 000000000..e6ba27f6c
--- /dev/null
+++ b/backend/account_v2/migrations/0005_alter_platformkey_organization.py
@@ -0,0 +1,25 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0004_user_is_service_account"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="platformkey",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ related_name="platform_keys",
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/account_v2/models.py b/backend/account_v2/models.py
index 5a3250bdd..eb6b81d8b 100644
--- a/backend/account_v2/models.py
+++ b/backend/account_v2/models.py
@@ -125,6 +125,8 @@ class PlatformKey(models.Model):
related_name="platform_keys",
null=True,
blank=True,
+ # Server-managed; never accepted as client input.
+ editable=False,
)
created_by = models.ForeignKey(
"User",
diff --git a/backend/adapter_processor_v2/migrations/0004_alter_adapterinstance_organization.py b/backend/adapter_processor_v2/migrations/0004_alter_adapterinstance_organization.py
new file mode 100644
index 000000000..2ea9d7de3
--- /dev/null
+++ b/backend/adapter_processor_v2/migrations/0004_alter_adapterinstance_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("adapter_processor_v2", "0003_mark_deprecated_adapters"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="adapterinstance",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/adapter_processor_v2/tests/test_org_editable.py b/backend/adapter_processor_v2/tests/test_org_editable.py
new file mode 100644
index 000000000..1fc928098
--- /dev/null
+++ b/backend/adapter_processor_v2/tests/test_org_editable.py
@@ -0,0 +1,78 @@
+"""Guard: server-managed ``organization`` stays out of writable serializer input.
+
+``organization`` is set server-side, never sent by clients. Marking it
+``editable=False`` on the model keeps DRF from exposing it as a writable
+field, which in turn keeps it out of the auto-generated multi-field
+uniqueness validators (DRF 3.15+) that would otherwise reject every create
+with ``organization: This field is required``.
+
+The field-level invariant is the root-cause guard: if ``organization`` stays
+``editable=False`` on every org-scoped model, no serializer can re-expose it.
+The adapter serializer cases additionally pin the concrete DRF-3.15 symptom.
+No test database is required (model/serializer setup only).
+"""
+
+from __future__ import annotations
+
+import os
+
+import django
+from django.apps import apps
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backend.settings.test")
+if not apps.ready:
+ django.setup()
+
+import pytest # noqa: E402
+from rest_framework.validators import UniqueTogetherValidator # noqa: E402
+
+from adapter_processor_v2.serializers import AdapterInstanceSerializer # noqa: E402
+
+# Every org-scoped model whose ``organization`` FK must stay non-editable:
+# mixin users plus the five models that declare the FK directly.
+ORG_SCOPED_MODELS = [
+ ("adapter_processor_v2", "AdapterInstance"),
+ ("api_v2", "APIDeployment"),
+ ("api_v2", "OrganizationRateLimit"),
+ ("connector_v2", "ConnectorInstance"),
+ ("pipeline_v2", "Pipeline"),
+ ("tags", "Tag"),
+ ("workflow_v2", "Workflow"),
+ ("configuration", "Configuration"),
+ ("account_v2", "PlatformKey"),
+ ("tenant_account_v2", "OrganizationGroup"),
+ ("tenant_account_v2", "ResourceGroupShare"),
+ ("notification_v2", "NotificationBuffer"),
+]
+
+
[email protected]("app_label,model_name", ORG_SCOPED_MODELS)
+def test_organization_field_not_editable(app_label, model_name):
+ field = apps.get_model(app_label, model_name)._meta.get_field("organization")
+ assert field.editable is False
+
+
+def test_adapter_serializer_org_read_only():
+ assert AdapterInstanceSerializer().fields["organization"].read_only is True
+
+
+def test_adapter_no_uniqueness_validator_references_organization():
+ serializer = AdapterInstanceSerializer()
+ offending = [
+ v
+ for v in serializer.validators
+ if isinstance(v, UniqueTogetherValidator) and "organization" in tuple(v.fields)
+ ]
+ assert offending == []
+
+
+def test_adapter_create_payload_without_organization_validates():
+ payload = {
+ "adapter_id": "openai|abc",
+ "adapter_name": "test-llm",
+ "adapter_type": "LLM",
+ "adapter_metadata": {"model": "gpt"},
+ }
+ serializer = AdapterInstanceSerializer(data=payload)
+ serializer.is_valid()
+ assert "organization" not in serializer.errors
diff --git a/backend/api_v2/admin.py b/backend/api_v2/admin.py
index 1e0b497e0..012c70a79 100644
--- a/backend/api_v2/admin.py
+++ b/backend/api_v2/admin.py
@@ -13,7 +13,9 @@ class OrganizationRateLimitAdmin(admin.ModelAdmin):
]
list_filter = ["created_at", "modified_at"]
search_fields = ["organization__name", "organization__organization_id"]
- readonly_fields = ["created_at", "modified_at"]
+ # organization is editable=False (server-managed); must be read-only here
+ # or the admin form build raises FieldError at page load.
+ readonly_fields = ["organization", "created_at", "modified_at"]
fieldsets = (
(
None,
diff --git a/backend/api_v2/migrations/0004_alter_apideployment_organization_and_more.py b/backend/api_v2/migrations/0004_alter_apideployment_organization_and_more.py
new file mode 100644
index 000000000..3b67d8e16
--- /dev/null
+++ b/backend/api_v2/migrations/0004_alter_apideployment_organization_and_more.py
@@ -0,0 +1,38 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("api_v2", "0003_add_organization_rate_limit"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="apideployment",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="organizationratelimit",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/configuration/migrations/0002_alter_configuration_organization.py b/backend/configuration/migrations/0002_alter_configuration_organization.py
new file mode 100644
index 000000000..83a80ba56
--- /dev/null
+++ b/backend/configuration/migrations/0002_alter_configuration_organization.py
@@ -0,0 +1,24 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("configuration", "0001_initial"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="configuration",
+ name="organization",
+ field=models.ForeignKey(
+ editable=False,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="organization_configuration",
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/configuration/models.py b/backend/configuration/models.py
index 1d31213a1..abb45523d 100644
--- a/backend/configuration/models.py
+++ b/backend/configuration/models.py
@@ -27,7 +27,11 @@ class Configuration(BaseModel):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
organization = models.ForeignKey(
- Organization, on_delete=models.CASCADE, related_name="organization_configuration"
+ Organization,
+ on_delete=models.CASCADE,
+ related_name="organization_configuration",
+ # Server-managed; never accepted as client input.
+ editable=False,
)
key = models.CharField(
max_length=100,
diff --git a/backend/connector_v2/migrations/0006_alter_connectorinstance_organization.py b/backend/connector_v2/migrations/0006_alter_connectorinstance_organization.py
new file mode 100644
index 000000000..923db782e
--- /dev/null
+++ b/backend/connector_v2/migrations/0006_alter_connectorinstance_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("connector_v2", "0005_fix_unintended_connector_sharing"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="connectorinstance",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/dashboard_metrics/migrations/0003_alter_eventmetricsdaily_organization_and_more.py b/backend/dashboard_metrics/migrations/0003_alter_eventmetricsdaily_organization_and_more.py
new file mode 100644
index 000000000..0f940e1f0
--- /dev/null
+++ b/backend/dashboard_metrics/migrations/0003_alter_eventmetricsdaily_organization_and_more.py
@@ -0,0 +1,50 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("dashboard_metrics", "0002_setup_periodic_tasks"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="eventmetricsdaily",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="eventmetricshourly",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="eventmetricsmonthly",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/notification_v2/migrations/0003_alter_notificationbuffer_organization.py b/backend/notification_v2/migrations/0003_alter_notificationbuffer_organization.py
new file mode 100644
index 000000000..97735840b
--- /dev/null
+++ b/backend/notification_v2/migrations/0003_alter_notificationbuffer_organization.py
@@ -0,0 +1,25 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("notification_v2", "0002_notification_batching"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="notificationbuffer",
+ name="organization",
+ field=models.ForeignKey(
+ db_comment="Tenant scope. Mandatory grouping key — prevents cross-tenant leakage at flush time.",
+ editable=False,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="notification_buffer_rows",
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/notification_v2/models.py b/backend/notification_v2/models.py
index 74a891232..02409c3e5 100644
--- a/backend/notification_v2/models.py
+++ b/backend/notification_v2/models.py
@@ -139,6 +139,8 @@ class NotificationBuffer(BaseModel):
"Tenant scope. Mandatory grouping key — prevents cross-tenant "
"leakage at flush time."
),
+ # Server-managed; never accepted as client input.
+ editable=False,
)
webhook_url = models.URLField(
db_comment="Denormalized destination URL; grouping key.",
diff --git a/backend/pipeline_v2/migrations/0004_alter_pipeline_organization.py b/backend/pipeline_v2/migrations/0004_alter_pipeline_organization.py
new file mode 100644
index 000000000..b0a3699bf
--- /dev/null
+++ b/backend/pipeline_v2/migrations/0004_alter_pipeline_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("pipeline_v2", "0003_add_sharing_fields_to_pipeline"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="pipeline",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/platform_api/migrations/0004_alter_platformapikey_organization.py b/backend/platform_api/migrations/0004_alter_platformapikey_organization.py
new file mode 100644
index 000000000..fb7eb6ee4
--- /dev/null
+++ b/backend/platform_api/migrations/0004_alter_platformapikey_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("platform_api", "0003_platformapikey_permission_check"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="platformapikey",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/prompt_studio/prompt_studio_core_v2/migrations/0008_alter_customtool_organization.py b/backend/prompt_studio/prompt_studio_core_v2/migrations/0008_alter_customtool_organization.py
new file mode 100644
index 000000000..bfde40db6
--- /dev/null
+++ b/backend/prompt_studio/prompt_studio_core_v2/migrations/0008_alter_customtool_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("prompt_studio_core_v2", "0007_customtool_last_exported_at"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="customtool",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/prompt_studio/prompt_studio_registry_v2/migrations/0002_alter_promptstudioregistry_organization.py b/backend/prompt_studio/prompt_studio_registry_v2/migrations/0002_alter_promptstudioregistry_organization.py
new file mode 100644
index 000000000..4515bb374
--- /dev/null
+++ b/backend/prompt_studio/prompt_studio_registry_v2/migrations/0002_alter_promptstudioregistry_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("prompt_studio_registry_v2", "0001_initial"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="promptstudioregistry",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/tags/migrations/0002_alter_tag_organization.py b/backend/tags/migrations/0002_alter_tag_organization.py
new file mode 100644
index 000000000..67a3492e9
--- /dev/null
+++ b/backend/tags/migrations/0002_alter_tag_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("tags", "0001_initial"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="tag",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/tenant_account_v2/migrations/0004_alter_organizationgroup_organization_and_more.py b/backend/tenant_account_v2/migrations/0004_alter_organizationgroup_organization_and_more.py
new file mode 100644
index 000000000..0023ce02f
--- /dev/null
+++ b/backend/tenant_account_v2/migrations/0004_alter_organizationgroup_organization_and_more.py
@@ -0,0 +1,46 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("tenant_account_v2", "0003_resource_group_share"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="organizationgroup",
+ name="organization",
+ field=models.ForeignKey(
+ editable=False,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="groups",
+ to="account_v2.organization",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="organizationmember",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="resourcegroupshare",
+ name="organization",
+ field=models.ForeignKey(
+ editable=False,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="resource_group_shares",
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/tenant_account_v2/models.py b/backend/tenant_account_v2/models.py
index 1d90c91ba..e6c4aa566 100644
--- a/backend/tenant_account_v2/models.py
+++ b/backend/tenant_account_v2/models.py
@@ -59,7 +59,11 @@ class OrganizationGroup(BaseModel):
"""
organization = models.ForeignKey(
- Organization, on_delete=models.CASCADE, related_name="groups"
+ Organization,
+ on_delete=models.CASCADE,
+ related_name="groups",
+ # Server-managed; never accepted as client input.
+ editable=False,
)
name = models.CharField(max_length=255)
description = models.TextField(blank=True)
@@ -109,6 +113,8 @@ class ResourceGroupShare(BaseModel):
Organization,
on_delete=models.CASCADE,
related_name="resource_group_shares",
+ # Server-managed; never accepted as client input.
+ editable=False,
)
class Meta:
diff --git a/backend/usage_v2/migrations/0006_alter_usage_organization.py b/backend/usage_v2/migrations/0006_alter_usage_organization.py
new file mode 100644
index 000000000..8d83b6cdd
--- /dev/null
+++ b/backend/usage_v2/migrations/0006_alter_usage_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("usage_v2", "0005_usage_reason_ref_created_idx"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="usage",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]
diff --git a/backend/utils/models/organization_mixin.py b/backend/utils/models/organization_mixin.py
index 1e178fe0c..f4d1d93d1 100644
--- a/backend/utils/models/organization_mixin.py
+++ b/backend/utils/models/organization_mixin.py
@@ -11,7 +11,8 @@ class DefaultOrganizationMixin(models.Model):
db_comment="Foreign key reference to the Organization model.",
null=True,
blank=True,
- default=None,
+ # Server-managed field; set in save(), never accepted as client input.
+ editable=False,
)
class Meta:
diff --git a/backend/workflow_manager/workflow_v2/migrations/0021_alter_workflow_organization.py b/backend/workflow_manager/workflow_v2/migrations/0021_alter_workflow_organization.py
new file mode 100644
index 000000000..cb76b4aad
--- /dev/null
+++ b/backend/workflow_manager/workflow_v2/migrations/0021_alter_workflow_organization.py
@@ -0,0 +1,26 @@
+# Generated by Django 4.2.30 on 2026-06-19 09:28
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0005_alter_platformkey_organization"),
+ ("workflow_v2", "0020_workflowexecution_file_counts"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="workflow",
+ name="organization",
+ field=models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Organization model.",
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="account_v2.organization",
+ ),
+ ),
+ ]