From ddb80bcb945d9bb614f988fd567c6c92b6670a5d Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 24 Dec 2023 17:41:35 +0200 Subject: [PATCH 01/11] adding new fields to form and sponsor model --- sponsors/forms.py | 7 +++++ .../migrations/0099_auto_20231224_1539.py | 29 ++++++++++++++++++ sponsors/models/sponsors.py | 9 +++++- templates/users/sponsor_info_update.html | 30 +++++++++++++++++-- 4 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 sponsors/migrations/0099_auto_20231224_1539.py diff --git a/sponsors/forms.py b/sponsors/forms.py index 8d262b337..1a5fc229c 100644 --- a/sponsors/forms.py +++ b/sponsors/forms.py @@ -251,11 +251,18 @@ class SponsorshipApplicationForm(forms.Form): state = forms.CharField( label="State/Province/Region", max_length=64, required=False ) + state_of_incorporation = forms.CharField( + label="State of incorporation", help_text="US only, if different from registered state", max_length=64, required=False + ) postal_code = forms.CharField( label="Zip/Postal Code", max_length=64, required=False ) country = CountryField().formfield(required=False) + country_of_incorporation = CountryField().formfield( + label="Country of incorporation", help_text="If different from registered country", required=False + ) + def __init__(self, *args, **kwargs): self.user = kwargs.pop("user", None) super().__init__(*args, **kwargs) diff --git a/sponsors/migrations/0099_auto_20231224_1539.py b/sponsors/migrations/0099_auto_20231224_1539.py new file mode 100644 index 000000000..065c4e786 --- /dev/null +++ b/sponsors/migrations/0099_auto_20231224_1539.py @@ -0,0 +1,29 @@ +# Generated by Django 2.2.24 on 2023-12-24 15:39 + +from django.db import migrations, models +import django_countries.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('sponsors', '0098_auto_20231219_1910'), + ] + + operations = [ + migrations.AddField( + model_name='sponsor', + name='country_of_incorporation', + field=django_countries.fields.CountryField(blank=True, max_length=2, null=True, verbose_name='Country of incorporation (If different)'), + ), + migrations.AddField( + model_name='sponsor', + name='state_of_incorporation', + field=models.CharField(blank=True, default='', max_length=64, null=True, verbose_name='US only: State of incorporation (If different)'), + ), + migrations.AlterField( + model_name='sponsor', + name='country', + field=django_countries.fields.CountryField(default='', help_text='For mailing/contact purposes', max_length=2), + ), + ] diff --git a/sponsors/models/sponsors.py b/sponsors/models/sponsors.py index 9b4d8fe86..feda8fc06 100644 --- a/sponsors/models/sponsors.py +++ b/sponsors/models/sponsors.py @@ -71,8 +71,15 @@ class Sponsor(ContentManageable): postal_code = models.CharField( verbose_name="Zip/Postal Code", max_length=64, default="" ) - country = CountryField(default="") + country = CountryField(default="", help_text="For mailing/contact purposes") assets = GenericRelation(GenericAsset) + country_of_incorporation = CountryField( + verbose_name="Country of incorporation (If different)", blank=True, null=True + ) + state_of_incorporation = models.CharField( + verbose_name="US only: State of incorporation (If different)", + max_length=64, blank=True, null=True, default="" + ) class Meta: verbose_name = "sponsor" diff --git a/templates/users/sponsor_info_update.html b/templates/users/sponsor_info_update.html index 3ae2e720c..2c1da5a21 100644 --- a/templates/users/sponsor_info_update.html +++ b/templates/users/sponsor_info_update.html @@ -69,16 +69,29 @@

Sponsor Information

- +
+

{% render_field form.country %} {% if form.country.help_text %} -
{{ form.country.help_text }} {% endif %}

+
+
+

+ + {% render_field form.country_of_incorporation %} + {% if form.country_of_incorporation.help_text %} +
+ {{ form.country_of_incorporation.help_text }} + {% endif %} +

+
+
@@ -131,8 +144,19 @@

Sponsor Information

{{ form.state.help_text }} {% endif %}

+
+
+

+ + {% render_field form.state %} + {% if form.state_of_incorporation.help_text %} +
+ {{ form.state_of_incorporation.help_text }} + {% endif %} +

+
-
From dc5ff5bd7e9b1b0465317b081ad1e0bd90998156 Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 24 Dec 2023 18:13:06 +0200 Subject: [PATCH 02/11] adding new optional fields to update sponsor application form --- sponsors/forms.py | 6 ++-- sponsors/models/sponsors.py | 2 +- .../new_sponsorship_application_form.html | 30 +++++++++++++++++-- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/sponsors/forms.py b/sponsors/forms.py index 1a5fc229c..04cacd876 100644 --- a/sponsors/forms.py +++ b/sponsors/forms.py @@ -252,15 +252,15 @@ class SponsorshipApplicationForm(forms.Form): label="State/Province/Region", max_length=64, required=False ) state_of_incorporation = forms.CharField( - label="State of incorporation", help_text="US only, if different from registered state", max_length=64, required=False + label="State of incorporation", help_text="US only, If different", max_length=64, required=False ) postal_code = forms.CharField( label="Zip/Postal Code", max_length=64, required=False ) - country = CountryField().formfield(required=False) + country = CountryField().formfield(required=False, help_text="For mailing/contact purposes") country_of_incorporation = CountryField().formfield( - label="Country of incorporation", help_text="If different from registered country", required=False + label="Country of incorporation", help_text="For contractual purposes", required=False ) def __init__(self, *args, **kwargs): diff --git a/sponsors/models/sponsors.py b/sponsors/models/sponsors.py index feda8fc06..7b92b0a92 100644 --- a/sponsors/models/sponsors.py +++ b/sponsors/models/sponsors.py @@ -74,7 +74,7 @@ class Sponsor(ContentManageable): country = CountryField(default="", help_text="For mailing/contact purposes") assets = GenericRelation(GenericAsset) country_of_incorporation = CountryField( - verbose_name="Country of incorporation (If different)", blank=True, null=True + verbose_name="Country of incorporation (If different)", help_text="For contractual purposes", blank=True, null=True ) state_of_incorporation = models.CharField( verbose_name="US only: State of incorporation (If different)", diff --git a/templates/sponsors/new_sponsorship_application_form.html b/templates/sponsors/new_sponsorship_application_form.html index 9f7597650..29181f80f 100644 --- a/templates/sponsors/new_sponsorship_application_form.html +++ b/templates/sponsors/new_sponsorship_application_form.html @@ -94,7 +94,8 @@

Submit Sponsorship Information

- +
+

{% render_field form.country %} @@ -103,6 +104,19 @@

Submit Sponsorship Information

{{ form.country.help_text }} {% endif %}

+
+
+

+ + {% render_field form.country_of_incorporation %} + {% if form.country_of_incorporation.help_text %} +
+ {{ form.country_of_incorporation.help_text }} + {% endif %} +

+
+
@@ -149,7 +163,19 @@

Submit Sponsorship Information

{{ form.state.help_text }} {% endif %}

-
+
+ +
+

+ + {% render_field form.state %} + {% if form.state_of_incorporation.help_text %} +
+ {{ form.state_of_incorporation.help_text }} + {% endif %} +

+
From 7f73df0340801610e89945964a90bcde1fdd46e0 Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 24 Dec 2023 18:15:47 +0200 Subject: [PATCH 03/11] fix migrations --- ...{0099_auto_20231224_1539.py => 0099_auto_20231224_1615.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename sponsors/migrations/{0099_auto_20231224_1539.py => 0099_auto_20231224_1615.py} (83%) diff --git a/sponsors/migrations/0099_auto_20231224_1539.py b/sponsors/migrations/0099_auto_20231224_1615.py similarity index 83% rename from sponsors/migrations/0099_auto_20231224_1539.py rename to sponsors/migrations/0099_auto_20231224_1615.py index 065c4e786..8cc05097f 100644 --- a/sponsors/migrations/0099_auto_20231224_1539.py +++ b/sponsors/migrations/0099_auto_20231224_1615.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.24 on 2023-12-24 15:39 +# Generated by Django 2.2.24 on 2023-12-24 16:15 from django.db import migrations, models import django_countries.fields @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='sponsor', name='country_of_incorporation', - field=django_countries.fields.CountryField(blank=True, max_length=2, null=True, verbose_name='Country of incorporation (If different)'), + field=django_countries.fields.CountryField(blank=True, help_text='For contractual purposes', max_length=2, null=True, verbose_name='Country of incorporation (If different)'), ), migrations.AddField( model_name='sponsor', From 091f7bfe7d58608baa8bef6000300b64250c89ad Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sat, 30 Dec 2023 15:02:24 +0200 Subject: [PATCH 04/11] modifying existing tests to assert new fields are correctly saved --- sponsors/forms.py | 2 ++ sponsors/tests/test_forms.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sponsors/forms.py b/sponsors/forms.py index 04cacd876..6033a0b18 100644 --- a/sponsors/forms.py +++ b/sponsors/forms.py @@ -378,6 +378,8 @@ def save(self): landing_page_url=self.cleaned_data.get("landing_page_url", ""), twitter_handle=self.cleaned_data["twitter_handle"], print_logo=self.cleaned_data.get("print_logo"), + country_of_incorporation=self.cleaned_data.get("country_of_incorporation", ""), + state_of_incorporation=self.cleaned_data.get("state_of_incorporation", ""), ) contacts = [f.save(commit=False) for f in self.contacts_formset.forms] for contact in contacts: diff --git a/sponsors/tests/test_forms.py b/sponsors/tests/test_forms.py index 058e21625..3d9342927 100644 --- a/sponsors/tests/test_forms.py +++ b/sponsors/tests/test_forms.py @@ -420,14 +420,18 @@ def test_create_sponsor_with_valid_data(self): def test_create_sponsor_with_valid_data_for_non_required_inputs( self, ): + user = baker.make(settings.AUTH_USER_MODEL) + self.data["description"] = "Important company" self.data["landing_page_url"] = "https://companyx.com" self.data["twitter_handle"] = "@companyx" + self.data["country_of_incorporation"] = "US" + self.data["state_of_incorporation"] = "NY" self.files["print_logo"] = get_static_image_file_as_upload( "psf-logo_print.png", "logo_print.png" ) - form = SponsorshipApplicationForm(self.data, self.files) + form = SponsorshipApplicationForm(self.data, self.files, user=user) self.assertTrue(form.is_valid(), form.errors) sponsor = form.save() @@ -437,6 +441,8 @@ def test_create_sponsor_with_valid_data_for_non_required_inputs( self.assertFalse(form.user_with_previous_sponsors) self.assertEqual(sponsor.landing_page_url, "https://companyx.com") self.assertEqual(sponsor.twitter_handle, "@companyx") + self.assertEqual(sponsor.country_of_incorporation, "US") + self.assertEqual(sponsor.state_of_incorporation, "NY") def test_use_previous_user_sponsor(self): contact = baker.make(SponsorContact, user__email="foo@foo.com") From 4c3236450ec88fd58bd30ec5e281687a01286679 Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 2 Jan 2024 08:43:06 -0500 Subject: [PATCH 05/11] Re-structure and re-order sponsor information form --- sponsors/forms.py | 2 +- .../new_sponsorship_application_form.html | 129 ++++++++++-------- 2 files changed, 71 insertions(+), 60 deletions(-) diff --git a/sponsors/forms.py b/sponsors/forms.py index 6033a0b18..c6a3d0bde 100644 --- a/sponsors/forms.py +++ b/sponsors/forms.py @@ -252,7 +252,7 @@ class SponsorshipApplicationForm(forms.Form): label="State/Province/Region", max_length=64, required=False ) state_of_incorporation = forms.CharField( - label="State of incorporation", help_text="US only, If different", max_length=64, required=False + label="State of incorporation", help_text="US only, If different than mailing address", max_length=64, required=False ) postal_code = forms.CharField( label="Zip/Postal Code", max_length=64, required=False diff --git a/templates/sponsors/new_sponsorship_application_form.html b/templates/sponsors/new_sponsorship_application_form.html index 29181f80f..ddce38459 100644 --- a/templates/sponsors/new_sponsorship_application_form.html +++ b/templates/sponsors/new_sponsorship_application_form.html @@ -53,6 +53,8 @@

Submit Sponsorship Information

+

Basics

+

{% render_field form.name %} @@ -62,6 +64,33 @@

Submit Sponsorship Information

{% endif %}

+ +
+
+

+ + {% render_field form.country_of_incorporation %} + {% if form.country_of_incorporation.help_text %} +
+ {{ form.country_of_incorporation.help_text }} + {% endif %} +

+
+ +
+

+ + {% render_field form.state %} + {% if form.state_of_incorporation.help_text %} +
+ {{ form.state_of_incorporation.help_text }} + {% endif %} +

+
+
+

{% render_field form.description %} @@ -94,29 +123,34 @@

Submit Sponsorship Information

-
-
-

- - {% render_field form.country %} - {% if form.country.help_text %} -
- {{ form.country.help_text }} - {% endif %} -

-
-
-

- - {% render_field form.country_of_incorporation %} - {% if form.country_of_incorporation.help_text %} -
- {{ form.country_of_incorporation.help_text }} - {% endif %} -

-
-
+ +
+
+

+ + {% render_field form.web_logo %} + {% if form.web_logo.help_text %} +
+ {{ form.web_logo.help_text }} + {% endif %} +

+
+ +
+

+ + {% render_field form.print_logo %} + {% if form.print_logo.help_text %} +
+ {{ form.print_logo.help_text }} + {% endif %} +

+
+
+ +
+ +

Mailing and Contact

@@ -163,19 +197,7 @@

Submit Sponsorship Information

{{ form.state.help_text }} {% endif %}

-
- -
-

- - {% render_field form.state %} - {% if form.state_of_incorporation.help_text %} -
- {{ form.state_of_incorporation.help_text }} - {% endif %} -

-
+
@@ -193,11 +215,11 @@

Submit Sponsorship Information

- - {% render_field form.primary_phone %} - {% if form.primary_phone.help_text %} + + {% render_field form.country %} + {% if form.country.help_text %}
- {{ form.primary_phone.help_text }} + {{ form.country.help_text }} {% endif %}

@@ -205,25 +227,14 @@

Submit Sponsorship Information

-

- - {% render_field form.web_logo %} - {% if form.web_logo.help_text %} -
- {{ form.web_logo.help_text }} - {% endif %} -

-
- -
-

- - {% render_field form.print_logo %} - {% if form.print_logo.help_text %} -
- {{ form.print_logo.help_text }} - {% endif %} -

+

+ + {% render_field form.primary_phone %} + {% if form.primary_phone.help_text %} +
+ {{ form.primary_phone.help_text }} + {% endif %} +

From bfa4e1a2dc260ea2a5426b1dc260e601fd6ed118 Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 7 Jan 2024 11:59:49 +0200 Subject: [PATCH 06/11] update and refactor of new_sponsorship_application_form to be usable for editing --- .../new_sponsorship_application_form.html | 27 ++++++++++++++++--- templates/users/sponsor_info_update.html | 25 +++++++++++++++++ users/views.py | 2 +- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/templates/sponsors/new_sponsorship_application_form.html b/templates/sponsors/new_sponsorship_application_form.html index ddce38459..1610807e8 100644 --- a/templates/sponsors/new_sponsorship_application_form.html +++ b/templates/sponsors/new_sponsorship_application_form.html @@ -2,15 +2,19 @@ {% load boxes widget_tweaks %} {% load humanize %} {% load sponsors %} +{% block page_title %}Sponsorship Information{% endblock %} -{% block page_title %}Submit Sponsorship Information{% endblock %} {% block content %}
-

Submit Sponsorship Information

-
+{% if sponsor %} +
+

Edit {{sponsor}}

+
+{% else %} +
{% if sponsorship_package %}

You selected the {{ sponsorship_package.name }} package {% if sponsorship_price %}costing ${{ sponsorship_price|intcomma }} USD {% endif %}and the following benefits: @@ -34,6 +38,10 @@

Submit Sponsorship Information

| Back to select benefits
+

Submit Sponsorship Information

+{% endif %} + + {% if form.errors %} The form has one or more errors {{ form.non_field_errors }} @@ -129,6 +137,9 @@

Basics

{% render_field form.web_logo %} + {% if sponsor.web_logo %} +

Currently: {{ sponsor.web_logo.name }}

+ {% endif %} {% if form.web_logo.help_text %}
{{ form.web_logo.help_text }} @@ -140,6 +151,9 @@

Basics

{% render_field form.print_logo %} + {% if sponsor.print_logo %} +

Currently: {{ sponsor.print_logo.name }}

+ {% endif %} {% if form.print_logo.help_text %}
{{ form.print_logo.help_text }} @@ -253,11 +267,16 @@

Contacts

- +{% if sponsor %} +
+ +
+ {% else %} + {% endif %}
{% endblock content %} diff --git a/templates/users/sponsor_info_update.html b/templates/users/sponsor_info_update.html index 2c1da5a21..e1984a28c 100644 --- a/templates/users/sponsor_info_update.html +++ b/templates/users/sponsor_info_update.html @@ -17,6 +17,7 @@ {% block user_content %}

Edit {{ sponsor }}

+

Basics

{% if form.errors %} The form has one or more errors @@ -36,7 +37,31 @@

Sponsor Information

{% endif %} {% render_field form.name %}

+
+
+

+ + {% render_field form.country_of_incorporation %} + {% if form.country_of_incorporation.help_text %} +
+ {{ form.country_of_incorporation.help_text }} + {% endif %} +

+
+
+

+ + {% render_field form.state %} + {% if form.state_of_incorporation.help_text %} +
+ {{ form.state_of_incorporation.help_text }} + {% endif %} +

+
+

diff --git a/users/views.py b/users/views.py index 517c1419a..c56dbace4 100644 --- a/users/views.py +++ b/users/views.py @@ -264,7 +264,7 @@ def get_context_data(self, *args, **kwargs): @method_decorator(login_required(login_url=settings.LOGIN_URL), name="dispatch") class UpdateSponsorInfoView(UpdateView): object_name = "sponsor" - template_name = 'users/sponsor_info_update.html' + template_name = 'sponsors/new_sponsorship_application_form.html' form_class = SponsorUpdateForm def get_queryset(self): From a256113a30005d645f3ce62b1796efeab4a1caa0 Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 7 Jan 2024 12:36:44 +0200 Subject: [PATCH 07/11] remove migration --- .../migrations/0099_auto_20231224_1615.py | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 sponsors/migrations/0099_auto_20231224_1615.py diff --git a/sponsors/migrations/0099_auto_20231224_1615.py b/sponsors/migrations/0099_auto_20231224_1615.py deleted file mode 100644 index 8cc05097f..000000000 --- a/sponsors/migrations/0099_auto_20231224_1615.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 2.2.24 on 2023-12-24 16:15 - -from django.db import migrations, models -import django_countries.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('sponsors', '0098_auto_20231219_1910'), - ] - - operations = [ - migrations.AddField( - model_name='sponsor', - name='country_of_incorporation', - field=django_countries.fields.CountryField(blank=True, help_text='For contractual purposes', max_length=2, null=True, verbose_name='Country of incorporation (If different)'), - ), - migrations.AddField( - model_name='sponsor', - name='state_of_incorporation', - field=models.CharField(blank=True, default='', max_length=64, null=True, verbose_name='US only: State of incorporation (If different)'), - ), - migrations.AlterField( - model_name='sponsor', - name='country', - field=django_countries.fields.CountryField(default='', help_text='For mailing/contact purposes', max_length=2), - ), - ] From dd8943c815d6c07a3758923ed61b70eb3cde71d1 Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 7 Jan 2024 12:38:31 +0200 Subject: [PATCH 08/11] new migration file added --- .../migrations/0099_auto_20240107_1038.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sponsors/migrations/0099_auto_20240107_1038.py diff --git a/sponsors/migrations/0099_auto_20240107_1038.py b/sponsors/migrations/0099_auto_20240107_1038.py new file mode 100644 index 000000000..8b73590af --- /dev/null +++ b/sponsors/migrations/0099_auto_20240107_1038.py @@ -0,0 +1,29 @@ +# Generated by Django 2.2.24 on 2024-01-07 10:38 + +from django.db import migrations, models +import django_countries.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('sponsors', '0098_auto_20231219_1910'), + ] + + operations = [ + migrations.AddField( + model_name='sponsor', + name='country_of_incorporation', + field=django_countries.fields.CountryField(blank=True, help_text='For contractual purposes', max_length=2, null=True, verbose_name='Country of incorporation (If different)'), + ), + migrations.AddField( + model_name='sponsor', + name='state_of_incorporation', + field=models.CharField(blank=True, default='', max_length=64, null=True, verbose_name='US only: State of incorporation (If different)'), + ), + migrations.AlterField( + model_name='sponsor', + name='country', + field=django_countries.fields.CountryField(default='', help_text='For mailing/contact purposes', max_length=2), + ), + ] From 65bbf1523fd773448907fddf458981bf40c8c71c Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 7 Jan 2024 12:43:51 +0200 Subject: [PATCH 09/11] merge --- .../migrations/0099_auto_20240107_1038.py | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 sponsors/migrations/0099_auto_20240107_1038.py diff --git a/sponsors/migrations/0099_auto_20240107_1038.py b/sponsors/migrations/0099_auto_20240107_1038.py deleted file mode 100644 index 8b73590af..000000000 --- a/sponsors/migrations/0099_auto_20240107_1038.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 2.2.24 on 2024-01-07 10:38 - -from django.db import migrations, models -import django_countries.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('sponsors', '0098_auto_20231219_1910'), - ] - - operations = [ - migrations.AddField( - model_name='sponsor', - name='country_of_incorporation', - field=django_countries.fields.CountryField(blank=True, help_text='For contractual purposes', max_length=2, null=True, verbose_name='Country of incorporation (If different)'), - ), - migrations.AddField( - model_name='sponsor', - name='state_of_incorporation', - field=models.CharField(blank=True, default='', max_length=64, null=True, verbose_name='US only: State of incorporation (If different)'), - ), - migrations.AlterField( - model_name='sponsor', - name='country', - field=django_countries.fields.CountryField(default='', help_text='For mailing/contact purposes', max_length=2), - ), - ] From 55bb2d49c496aa208ef0666a17fdff7014416157 Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 7 Jan 2024 12:54:19 +0200 Subject: [PATCH 10/11] add migration --- .../migrations/0100_auto_20240107_1054.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sponsors/migrations/0100_auto_20240107_1054.py diff --git a/sponsors/migrations/0100_auto_20240107_1054.py b/sponsors/migrations/0100_auto_20240107_1054.py new file mode 100644 index 000000000..8bad2bc92 --- /dev/null +++ b/sponsors/migrations/0100_auto_20240107_1054.py @@ -0,0 +1,29 @@ +# Generated by Django 2.2.24 on 2024-01-07 10:54 + +from django.db import migrations, models +import django_countries.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('sponsors', '0099_auto_20231224_1854'), + ] + + operations = [ + migrations.AddField( + model_name='sponsor', + name='country_of_incorporation', + field=django_countries.fields.CountryField(blank=True, help_text='For contractual purposes', max_length=2, null=True, verbose_name='Country of incorporation (If different)'), + ), + migrations.AddField( + model_name='sponsor', + name='state_of_incorporation', + field=models.CharField(blank=True, default='', max_length=64, null=True, verbose_name='US only: State of incorporation (If different)'), + ), + migrations.AlterField( + model_name='sponsor', + name='country', + field=django_countries.fields.CountryField(default='', help_text='For mailing/contact purposes', max_length=2), + ), + ] From 9c53e6a660bae2e3d223a1accfb987f4912c45bc Mon Sep 17 00:00:00 2001 From: jessiebelle Date: Sun, 7 Jan 2024 13:04:57 +0200 Subject: [PATCH 11/11] fix tests to reflect update in template --- users/tests/test_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/tests/test_views.py b/users/tests/test_views.py index 952425c98..13c226e5f 100644 --- a/users/tests/test_views.py +++ b/users/tests/test_views.py @@ -489,7 +489,7 @@ def test_display_template_with_sponsor_info(self): response = self.client.get(self.url) context = response.context - self.assertTemplateUsed(response, "users/sponsor_info_update.html") + self.assertTemplateUsed(response, "sponsors/new_sponsorship_application_form.html") self.assertEqual(context["sponsor"], self.sponsor) self.assertIsInstance(context["form"], SponsorUpdateForm)