diff options
| author | Magnus Hagander | 2024-11-26 11:50:56 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2024-11-27 10:53:13 +0000 |
| commit | aaa2f5d3097f82a951b46796a97b841e07ce482e (patch) | |
| tree | 17ba8aea46e5204a62204fd3b9851225a1d2677d /postgresqleu | |
| parent | bba79de479d311cfa6c389b6b0e5632f72284027 (diff) | |
Fix creation of regtypes that have cost
Commit f128188bd back in 2018 made it impossible to change the cost of a
registration type if it had been used. This apparently also broke
creation of new registration types that had a cost from the first save,
which apparently hasn't really been used since. (It would not break
copy-from-other-conference, so maybe that's what people used)
Diffstat (limited to 'postgresqleu')
| -rw-r--r-- | postgresqleu/confreg/backendforms.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/postgresqleu/confreg/backendforms.py b/postgresqleu/confreg/backendforms.py index 70cfdc14..d08f044f 100644 --- a/postgresqleu/confreg/backendforms.py +++ b/postgresqleu/confreg/backendforms.py @@ -473,7 +473,7 @@ class BackendRegistrationTypeForm(BackendForm): if self.cleaned_data['cost'] > 0 and not self.conference.paymentmethods.exists(): raise ValidationError("Cannot assign a cost, this conference has no payment methods") - if self.instance and self.instance.cost != self.cleaned_data['cost']: + if self.instance and self.instance.pk and self.instance.cost != self.cleaned_data['cost']: if self.instance.conferenceregistration_set.filter(Q(payconfirmedat__isnull=False) | Q(invoice__isnull=False) | Q(bulkpayment__isnull=False)).exists(): raise ValidationError("This registration type has been used, so the cost can no longer be changed") |
