From ad35ac234adf4a70e60efa417dd4323438c55731 Mon Sep 17 00:00:00 2001 From: drake Date: Thu, 26 Feb 2026 17:49:32 -0800 Subject: [PATCH 1/2] Rename partner_logo to affiliate_logo and update core models/tests --- app/core/admin.py | 4 ++-- app/core/api/serializers.py | 4 ++-- app/core/api/views.py | 6 ++--- ...me_partner_logo_affiliate_logo_and_more.py | 23 +++++++++++++++++++ app/core/migrations/max_migration.txt | 2 +- app/core/models.py | 6 ++--- app/core/tests/conftest.py | 2 +- app/core/tests/test_api.py | 4 ++-- app/core/tests/test_models.py | 1 - 9 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 app/core/migrations/0053_rename_partner_logo_affiliate_logo_and_more.py diff --git a/app/core/admin.py b/app/core/admin.py index 609276a9..a3419bf6 100644 --- a/app/core/admin.py +++ b/app/core/admin.py @@ -172,8 +172,8 @@ class PracticeAreaAdmin(admin.ModelAdmin): @admin.register(Affiliate) class AffiliateAdmin(admin.ModelAdmin): list_display = ( - "partner_name", - "partner_logo", + "name", + "logo", "is_active", "url", "is_org_sponsor", diff --git a/app/core/api/serializers.py b/app/core/api/serializers.py index 171a8722..49e6f7bc 100644 --- a/app/core/api/serializers.py +++ b/app/core/api/serializers.py @@ -205,8 +205,8 @@ class Meta: model = Affiliate fields = ( "uuid", - "partner_name", - "partner_logo", + "name", + "logo", "is_active", "url", "is_org_sponsor", diff --git a/app/core/api/views.py b/app/core/api/views.py index dd571e53..8f447d9d 100644 --- a/app/core/api/views.py +++ b/app/core/api/views.py @@ -247,9 +247,9 @@ class AffiliateViewSet(viewsets.ModelViewSet): # Optionally filter sponsor partners by name, is_active, and/or is_sponsor query parameters in the URL # """ # queryset = Affiliate.objects.all() - # partner_name = self.request.query_params.get("partner_name") - # if partner_name is not None: - # queryset = queryset.filter(partner_name=partner_name) + # name = self.request.query_params.get("name") + # if name is not None: + # queryset = queryset.filter(name=name) # is_active = self.request.query_params.get("is_active") # if is_active is not None: # queryset = queryset.filter(is_active=is_active) diff --git a/app/core/migrations/0053_rename_partner_logo_affiliate_logo_and_more.py b/app/core/migrations/0053_rename_partner_logo_affiliate_logo_and_more.py new file mode 100644 index 00000000..dbd2783d --- /dev/null +++ b/app/core/migrations/0053_rename_partner_logo_affiliate_logo_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.27 on 2026-02-20 02:57 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0052_useremploymenthistory'), + ] + + operations = [ + migrations.RenameField( + model_name='affiliate', + old_name='partner_logo', + new_name='logo', + ), + migrations.RenameField( + model_name='affiliate', + old_name='partner_name', + new_name='name', + ), + ] diff --git a/app/core/migrations/max_migration.txt b/app/core/migrations/max_migration.txt index 4689aaa2..4555447f 100644 --- a/app/core/migrations/max_migration.txt +++ b/app/core/migrations/max_migration.txt @@ -1 +1 @@ -0052_useremploymenthistory +0053_rename_partner_logo_affiliate_logo_and_more diff --git a/app/core/models.py b/app/core/models.py index 998db883..7fc84c90 100644 --- a/app/core/models.py +++ b/app/core/models.py @@ -245,8 +245,8 @@ class Affiliate(AbstractBaseModel): Dictionary of sponsors and partners """ - partner_name = models.CharField(max_length=255) - partner_logo = models.URLField(blank=True) + name = models.CharField(max_length=255) + logo = models.URLField(blank=True) is_active = models.BooleanField(null=True) url = models.URLField(blank=True) is_org_sponsor = models.BooleanField(null=True) @@ -255,7 +255,7 @@ class Affiliate(AbstractBaseModel): # PK of this model is the ForeignKey for project_affiliate_xref def __str__(self): - return f"{self.partner_name}" + return f"{self.name}" class Faq(AbstractBaseModel): diff --git a/app/core/tests/conftest.py b/app/core/tests/conftest.py index a82a1e2c..400bec51 100644 --- a/app/core/tests/conftest.py +++ b/app/core/tests/conftest.py @@ -210,7 +210,7 @@ def admin_client(admin, client): @pytest.fixture def affiliate(): - return Affiliate.objects.create(partner_name="Test Affiliate") + return Affiliate.objects.create(name="Test Affiliate") @pytest.fixture diff --git a/app/core/tests/test_api.py b/app/core/tests/test_api.py index 17310c4d..05f29bfc 100644 --- a/app/core/tests/test_api.py +++ b/app/core/tests/test_api.py @@ -239,8 +239,8 @@ def test_create_event_type(auth_client): def test_create_affiliate(auth_client): payload = { - "partner_name": "Test Partner", - "partner_logo": "http://www.logourl.com", + "name": "Test Partner", + "logo": "http://www.logourl.com", "is_active": True, "url": "http://www.testurl.org", "is_org_sponsor": True, diff --git a/app/core/tests/test_models.py b/app/core/tests/test_models.py index 1364c884..49f42dd9 100644 --- a/app/core/tests/test_models.py +++ b/app/core/tests/test_models.py @@ -253,7 +253,6 @@ def test_affiliation_is_neither_partner_and_sponsor(affiliation4): assert xref_instance.is_partner is False assert str(xref_instance) == "Neither a partner or a sponsor" - def test_check_type(check_type): assert str(check_type) == "This is a test check_type." assert check_type.description == "This is a test check_type description." From ebbeca9cd656ba82c5f1934b5f8aaa58540a11ae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 01:52:45 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- app/core/tests/test_models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/core/tests/test_models.py b/app/core/tests/test_models.py index 49f42dd9..1364c884 100644 --- a/app/core/tests/test_models.py +++ b/app/core/tests/test_models.py @@ -253,6 +253,7 @@ def test_affiliation_is_neither_partner_and_sponsor(affiliation4): assert xref_instance.is_partner is False assert str(xref_instance) == "Neither a partner or a sponsor" + def test_check_type(check_type): assert str(check_type) == "This is a test check_type." assert check_type.description == "This is a test check_type description."