From 5bec4a51c6b8eca41c84201fb41bf33cc1fe6684 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Thu, 11 Mar 2021 15:50:57 -0500 Subject: [PATCH] Undo the polymorphic.SET_NULL for Organization It isn't polymorphic. --- .../0131_undo_org_polymorphic_ee.py | 19 +++++++++++++++++++ awx/main/models/organization.py | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 awx/main/migrations/0131_undo_org_polymorphic_ee.py diff --git a/awx/main/migrations/0131_undo_org_polymorphic_ee.py b/awx/main/migrations/0131_undo_org_polymorphic_ee.py new file mode 100644 index 0000000000..0805992243 --- /dev/null +++ b/awx/main/migrations/0131_undo_org_polymorphic_ee.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.16 on 2021-03-11 20:50 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0130_ee_polymorphic_set_null'), + ] + + operations = [ + migrations.AlterField( + model_name='organization', + name='default_environment', + field=models.ForeignKey(blank=True, default=None, help_text='The default execution environment for jobs run by this organization.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='main.ExecutionEnvironment'), + ), + ] diff --git a/awx/main/models/organization.py b/awx/main/models/organization.py index f087b8eb6b..f0ecfea5c7 100644 --- a/awx/main/models/organization.py +++ b/awx/main/models/organization.py @@ -27,7 +27,6 @@ from awx.main.models.rbac import ( ) from awx.main.models.unified_jobs import UnifiedJob from awx.main.models.mixins import ResourceMixin, CustomVirtualEnvMixin, RelatedJobsMixin -from awx.main.utils import polymorphic __all__ = ['Organization', 'Team', 'Profile', 'UserSessionMembership'] @@ -67,7 +66,7 @@ class Organization(CommonModel, NotificationFieldsModel, ResourceMixin, CustomVi null=True, blank=True, default=None, - on_delete=polymorphic.SET_NULL, + on_delete=models.SET_NULL, related_name='+', help_text=_('The default execution environment for jobs run by this organization.'), )