-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable to have sponsorship applications only with a la carte benefits (…
…#1946) * Add boolean field to flag a la carte benefits * Fix typo in form name * Display a la carte boolean and admin page and raise error if a la carte with associated package * Add filter for every benefit boolean flag * Add new field to form to list a la carte benefits * Make sure package is required, but not if submission only with a la carte * Remove unecessary end of regex and avoid warning message * Add slug to sponsorship packages to make it easier to uniquely reference them * Remove default value after running data migration * Assign a custom package if sponsorship application only with a la carte benefits * Make sure the view can handle a la carte only applications * Update sponsorships application form to list a la carte benefits * Propagate a la carte flag on SponsorBenefit objects * update all step titles in sponsorship form to a new svg plus bonus step if ever needed :-D Co-authored-by: Ee Durbin <[email protected]>
- Loading branch information
Showing
29 changed files
with
483 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 2.2.24 on 2021-12-20 14:22 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sponsors', '0062_auto_20211111_1529'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='sponsorshipbenefit', | ||
name='a_la_carte', | ||
field=models.BooleanField(default=False, help_text='À la carte benefits can be selected without the need of a package.', verbose_name='À La Carte'), | ||
), | ||
migrations.AlterField( | ||
model_name='requiredtextasset', | ||
name='label', | ||
field=models.CharField(help_text="What's the title used to display the text input to the sponsor?", max_length=256), | ||
), | ||
migrations.AlterField( | ||
model_name='requiredtextassetconfiguration', | ||
name='label', | ||
field=models.CharField(help_text="What's the title used to display the text input to the sponsor?", max_length=256), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.24 on 2021-12-23 13:08 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sponsors', '0063_auto_20211220_1422'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='sponsorshippackage', | ||
name='slug', | ||
field=models.SlugField(default='', help_text='Internal identifier used to reference this package.'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.2.24 on 2021-12-23 13:09 | ||
|
||
from django.db import migrations | ||
from django.utils.text import slugify | ||
|
||
|
||
def populate_packages_slugs(apps, schema_editor): | ||
SponsorshipPackage = apps.get_model("sponsors", "SponsorshipPackage") | ||
qs = SponsorshipPackage.objects.filter(slug="") | ||
for pkg in qs: | ||
pkg.slug = slugify(pkg.name) | ||
pkg.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sponsors', '0064_sponsorshippackage_slug'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(populate_packages_slugs, migrations.RunPython.noop) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.24 on 2021-12-23 13:18 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sponsors', '0065_auto_20211223_1309'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='sponsorshippackage', | ||
name='slug', | ||
field=models.SlugField(help_text='Internal identifier used to reference this package.'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.24 on 2021-12-24 14:21 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sponsors', '0066_auto_20211223_1318'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='sponsorbenefit', | ||
name='a_la_carte', | ||
field=models.BooleanField(blank=True, default=False, verbose_name='Added as a la carte benefit?'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.