Skip to content

Commit

Permalink
Fix creation of regtypes that have cost
Browse files Browse the repository at this point in the history
Commit f128188 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)
  • Loading branch information
mhagander committed Nov 27, 2024
1 parent bba79de commit aaa2f5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgresqleu/confreg/backendforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def clean_cost(self):
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")

Expand Down

0 comments on commit aaa2f5d

Please sign in to comment.