Commit 720811a7 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'cherry-pick-ee395fe0' into 'release/1.16'

Merge branch 'fix/registrations-form-entry-missing' into 'master'

See merge request !883
parents 0c20019c 837ac32a
......@@ -35,7 +35,8 @@ class MemberRegistrationForm(forms.ModelForm):
class Meta:
model = Registration
fields = '__all__'
exclude = ['created_at', 'updated_at', 'status', 'username', 'remarks']
exclude = ['created_at', 'updated_at', 'status', 'username', 'remarks',
'payment', 'membership']
class MemberRenewalForm(forms.ModelForm):
......
......@@ -271,7 +271,7 @@ class Registration(Entry):
if (self.starting_year is None and
self.membership_type is not Membership.SUPPORTER):
errors.update({
'username': _('This field is required.')})
'starting_year': _('This field is required.')})
if (self.programme is None and
self.membership_type is not Membership.SUPPORTER):
......
......@@ -129,14 +129,20 @@ class RegistrationTest(TestCase):
def test_require_programme_members(self):
self.registration.programme = None
with self.assertRaises(ValidationError):
with self.assertRaisesMessage(
ValidationError,
"{'programme': ['Dit veld is vereist.']}"
):
self.registration.clean()
self.registration.membership_type = Membership.SUPPORTER
self.registration.clean()
def test_require_starting_year_members(self):
self.registration.starting_year = None
with self.assertRaises(ValidationError):
with self.assertRaisesMessage(
ValidationError,
"{'starting_year': ['Dit veld is vereist.']}"
):
self.registration.clean()
self.registration.membership_type = Membership.SUPPORTER
self.registration.clean()
......
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