Skip to content
Snippets Groups Projects
Commit 5d285f74 authored by aeltheos's avatar aeltheos
Browse files

Renamed added field to birth_date and birth_location to match the LDAP

parent 799ee157
No related branches found
No related tags found
1 merge request!41Adding birth_date and birth_location field to follow new legal obligation
Pipeline #9556 passed with stages
in 3 minutes and 56 seconds
......@@ -47,19 +47,15 @@ class UserForm(forms.ModelForm):
class PersonForm(forms.ModelForm):
date_of_birth = forms.DateField(
label=_('Date of birth'),
required=True,
)
place_of_birth = forms.CharField(
label=_('Place of birth'),
max_length=256,
# Manually add birth_date on the form so that django does not fill the field with default value.
birth_date = forms.DateField(
label=_('Birth date'),
required=True,
)
class Meta:
model = Person
fields = ('address', 'telephone', 'date_of_birth', 'place_of_birth',)
fields = ('address', 'telephone', 'birth_date', 'birth_location',)
class OrganizationForm(forms.ModelForm):
......
......@@ -81,12 +81,12 @@ class Person(Profile):
max_length=40,
verbose_name=_("PGP fingerprint"),
)
date_of_birth = models.DateField(
verbose_name=_("Date of birth"),
birth_date = models.DateField(
verbose_name=_("Birth date"),
default=datetime(1970, 1, 1),
)
place_of_birth = models.CharField(
verbose_name=_("Place of birth"),
birth_location = models.CharField(
verbose_name=_("Birth location"),
max_length=256,
default="",
)
......
......@@ -34,8 +34,8 @@ class TestMembers(TestCase):
user=self.member,
address="France",
telephone="0123456789",
date_of_birth="1970-01-01",
place_of_birth="example"
birth_date="1970-01-01",
birth_location="example"
)
self.organization = User.objects.create(
......@@ -118,8 +118,8 @@ class TestMembers(TestCase):
'password2': "toto1234",
'address': "France",
'telephone': "0100000000",
'date_of_birth': "1970-01-01",
'place_of_birth': "example",
'birth_date': "1970-01-01",
'birth_location': "example",
'gtu': True,
'no_double_account': True,
})
......@@ -137,8 +137,8 @@ class TestMembers(TestCase):
'password2': "toto1234",
'address': "France",
'telephone': "0100000000",
'date_of_birth': "1970-01-01",
'place_of_birth': "example",
'birth_date': "1970-01-01",
'birth_location': "example",
'gtu': True,
'no_double_account': True,
})
......@@ -155,8 +155,8 @@ class TestMembers(TestCase):
'password2': "toto1234",
'address': "France",
'telephone': "0100000000",
'date_of_birth': "1970-01-01",
'place_of_birth': "example",
'birth_date': "1970-01-01",
'birth_location': "example",
'gtu': True,
'no_double_account': True,
})
......@@ -173,8 +173,8 @@ class TestMembers(TestCase):
'password2': "pouetpouet",
'address': "",
'telephone': "",
'date_of_birth': "",
'place_of_birth': "",
'birth_location': "",
'birth_place': "",
'gtu': True,
'no_double_account': True,
})
......@@ -227,8 +227,8 @@ class TestMembers(TestCase):
'email': "god@example.com",
'address': "Earth",
'telephone': "0123456789",
'date_of_birth': "1970-01-01",
'place_of_birth': "example",
'birth_date': "1970-01-01",
'birth_location': "example",
})
self.assertRedirects(response, reverse('member:user_detail', args=(self.admin.pk,)))
self.admin.refresh_from_db()
......@@ -242,8 +242,8 @@ class TestMembers(TestCase):
'email': "member@example.com",
'address': "Earth",
'telephone': "0123456789",
'date_of_birth': "1970-01-01",
'place_of_birth': "example",
'birth_date': "1970-01-01",
'birth_location': "example",
})
self.assertEqual(response.status_code, 200)
self.assertIn('email', response.context['form'].errors)
......@@ -256,8 +256,8 @@ class TestMembers(TestCase):
'email': "admin@example.com",
'address': "",
'telephone': "",
'date_of_birth': "",
'place_of_birth': "",
'birth_date': "",
'birth_location': "",
})
self.assertEqual(response.status_code, 200)
self.assertIn('address', response.context['profile_form'].errors)
......@@ -270,8 +270,8 @@ class TestMembers(TestCase):
'email': "god@example.com",
'address': "Earth",
'telephone': "0123456789",
'date_of_birth': "1970-01-01",
'place_of_birth': "example",
'birth_date': "1970-01-01",
'birth_location': "example",
})
self.assertEqual(response.status_code, 200)
self.assertIn('username', response.context['form'].errors)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment