Verified Commit fc7df1ef authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix saving new payment

parent f837d414
......@@ -252,7 +252,7 @@ def update_registration_by_organiser(registration, member, data):
and registration.payment is not None):
registration.payment.type = data['payment']['type']
registration.payment.save()
elif (data['payment']['type'] == Payment.NONE
elif (data['payment']['type'] != Payment.NONE
and registration.payment is None):
registration.payment = Payment.objects.create(
amount=registration.event.price,
......
......@@ -316,7 +316,7 @@ class RegistrationApiTest(TestCase):
self.assertEqual(field2.get_value_for(registration), None)
self.assertEqual(field3.get_value_for(registration), None)
response = self.client.put(
response = self.client.patch(
'/api/v1/registrations/{}/'.format(registration.pk), {
'fields[info_field_1]': True,
'fields[info_field_2]': 1337,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment