Skip to content

Commit

Permalink
Update sponsor partner to match latest ERD
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlaw528 authored and fyliu committed Nov 30, 2023
1 parent b2192ff commit 0ab1dbe
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ class SponsorPartnerAdmin(admin.ModelAdmin):
"partner_logo",
"is_active",
"url",
"is_sponsor",
"is_org_sponsor",
"is_org_partner",
)


Expand Down
3 changes: 2 additions & 1 deletion app/core/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ class Meta:
"partner_logo",
"is_active",
"url",
"is_sponsor",
"is_org_sponsor",
"is_org_partner",
)
read_only_fields = (
"uuid",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.0.10 on 2023-11-04 23:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [("core", "0019_stackelementtype")]

operations = [
migrations.RenameField(
model_name="sponsorpartner",
old_name="is_sponsor",
new_name="is_org_sponsor",
),
migrations.AddField(
model_name="sponsorpartner",
name="is_org_partner",
field=models.BooleanField(null=True),
),
]
2 changes: 1 addition & 1 deletion app/core/migrations/max_migration.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0019_stackelementtype
0020_rename_is_sponsor_sponsorpartner_is_org_partner_and_more
3 changes: 2 additions & 1 deletion app/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ class SponsorPartner(AbstractBaseModel):
partner_logo = models.URLField(blank=True)
is_active = models.BooleanField(null=True)
url = models.URLField(blank=True)
is_sponsor = models.BooleanField(null=True)
is_org_sponsor = models.BooleanField(null=True)
is_org_partner = models.BooleanField(null=True)

# PK of this model is the ForeignKey for project_partner_xref

Expand Down
3 changes: 2 additions & 1 deletion app/core/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def test_create_sponsor_partner(auth_client):
"partner_logo": "http://www.logourl.com",
"is_active": True,
"url": "http://www.testurl.org",
"is_sponsor": True,
"is_org_sponsor": True,
"is_org_partner": True,
}
res = auth_client.post(SPONSOR_PARTNERS_URL, payload)
assert res.status_code == status.HTTP_201_CREATED
Expand Down

0 comments on commit 0ab1dbe

Please sign in to comment.