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

Fix payment not being added to registration entry

parent c6962d91
......@@ -122,6 +122,9 @@ def accept_entries(queryset):
continue
payment = _create_payment_for_entry(entry)
entry.refresh_from_db()
try:
if entry.registration.username is None:
entry.registration.username = _generate_username(
......
......@@ -183,6 +183,11 @@ class ServicesTest(TestCase):
rows_updated = services.accept_entries(Entry.objects.all())
self.e2.refresh_from_db()
self.e3.refresh_from_db()
self.assertNotEqual(self.e2.payment, None)
self.assertNotEqual(self.e3.payment, None)
self.assertEqual(self.e2.username, 'ptest')
self.assertEqual(rows_updated, 3)
......
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