Skip to content

Commit

Permalink
tidy and fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jessiebelle committed Dec 18, 2023
1 parent 2a10170 commit 7911d04
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions sponsors/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ def __init__(self, *args, **kwargs):
for field_name in self.fields:
self.fields[field_name].required = True


class Meta:
model = Sponsorship
fields = ["start_date", "end_date", "package", "sponsorship_fee"]
Expand Down
4 changes: 2 additions & 2 deletions sponsors/migrations/0097_sponsorship_renewal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 2.2.24 on 2023-12-16 19:14
# Generated by Django 2.2.24 on 2023-12-18 16:23

from django.db import migrations, models

Expand All @@ -13,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='sponsorship',
name='renewal',
field=models.BooleanField(default=False),
field=models.BooleanField(blank=True, null=True),
),
]
2 changes: 1 addition & 1 deletion sponsors/models/sponsorship.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class Sponsorship(models.Model):
package = models.ForeignKey(SponsorshipPackage, null=True, on_delete=models.SET_NULL)
sponsorship_fee = models.PositiveIntegerField(null=True, blank=True)
overlapped_by = models.ForeignKey("self", null=True, on_delete=models.SET_NULL)
renewal = models.BooleanField(default=False)
renewal = models.BooleanField(null=True, blank=True)

assets = GenericRelation(GenericAsset)

Expand Down
1 change: 0 additions & 1 deletion sponsors/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def _gen_docx_contract(output, contract, **context):
else:
template = os.path.join(settings.TEMPLATES_DIR, "sponsors", "admin", "contract-template.docx")
doc = DocxTemplate(template)
# context = _contract_context(contract, **context)
doc.render(context)
doc.save(output)
return output
Expand Down
2 changes: 1 addition & 1 deletion sponsors/use_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def execute(self, sponsorship, start_date, end_date, **kwargs):
if fee:
sponsorship.sponsorship_fee = fee
if renewal:
sponsorship.renewal = renewal
sponsorship.renewal = True

sponsorship.save()
contract = Contract.new(sponsorship)
Expand Down

0 comments on commit 7911d04

Please sign in to comment.