From d8fa3e4fbb96141f22a1aa34c29a028fe8fbb666 Mon Sep 17 00:00:00 2001 From: Lucian Hymer Date: Tue, 17 Sep 2024 09:29:35 -0600 Subject: [PATCH] feat(api): adding partner name to customization --- api/account/admin.py | 1 + api/account/api.py | 1 + .../0037_customization_partner_name.py | 21 +++++++++++++++++++ api/account/models.py | 8 +++++++ 4 files changed, 31 insertions(+) create mode 100644 api/account/migrations/0037_customization_partner_name.py diff --git a/api/account/admin.py b/api/account/admin.py index 558583295..0983bcce2 100644 --- a/api/account/admin.py +++ b/api/account/admin.py @@ -242,6 +242,7 @@ class CustomizationAdmin(ScorerModelAdmin): { "fields": [ "path", + "partner_name", "scorer_panel_title", "scorer_panel_text", "scorer", diff --git a/api/account/api.py b/api/account/api.py index 624a25302..84a94b24d 100644 --- a/api/account/api.py +++ b/api/account/api.py @@ -628,6 +628,7 @@ def get_account_customization(request, dashboard_path: str): return dict( key=customization.path, + partnerName=customization.partner_name, useCustomDashboardPanel=customization.use_custom_dashboard_panel, customizationTheme={ "colors": { diff --git a/api/account/migrations/0037_customization_partner_name.py b/api/account/migrations/0037_customization_partner_name.py new file mode 100644 index 000000000..826216674 --- /dev/null +++ b/api/account/migrations/0037_customization_partner_name.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.6 on 2024-09-17 15:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("account", "0036_customization_show_explanation_panel"), + ] + + operations = [ + migrations.AddField( + model_name="customization", + name="partner_name", + field=models.CharField( + default="Partner", + help_text="The name of the partner, e.g. Gitcoin", + max_length=100, + ), + ), + ] diff --git a/api/account/models.py b/api/account/models.py index 50c995f06..e9e9ee073 100644 --- a/api/account/models.py +++ b/api/account/models.py @@ -451,6 +451,14 @@ class CustomizationOnChainButtonAction(models.TextChoices): SIMPLE_LINK = "Simple Link" ONCHAIN_PUSH = "Onchain Push" + partner_name = models.CharField( + max_length=100, + null=False, + blank=False, + default="Partner", + help_text="The name of the partner, e.g. Gitcoin", + ) + path = models.CharField( max_length=100, db_index=True,