-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The Package model max field does not have a default value and is not set as required when creating. This causes causes an error when trying to book a company with the package.
itdagene/itdagene/app/company/models.py
Lines 17 to 18 in 888a14f
| max = models.PositiveIntegerField( | |
| blank=True, null=True, verbose_name=_("number of packages to sell") |
Method causing the error:
itdagene/itdagene/app/company/models.py
Lines 41 to 47 in 888a14f
| def update_available_spots(cls): | |
| for package in Package.objects.all(): | |
| if package.companies.all().count() >= package.max: | |
| package.is_full = True | |
| else: | |
| package.is_full = False | |
| package.save(log_it=False, notify_subscribers=False) |
Suggested fix:
Either:
- Remove
blank=True, null=True - Or allow blank, and ignore max when it is
None
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working