Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
constellation
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
constellation
Commits
5d285f74
Commit
5d285f74
authored
3 years ago
by
aeltheos
Browse files
Options
Downloads
Patches
Plain Diff
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
!41
Adding birth_date and birth_location field to follow new legal obligation
Pipeline
#9556
passed with stages
in 3 minutes and 56 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
member/forms.py
+4
-8
4 additions, 8 deletions
member/forms.py
member/models.py
+4
-4
4 additions, 4 deletions
member/models.py
member/tests.py
+18
-18
18 additions, 18 deletions
member/tests.py
with
26 additions
and
30 deletions
member/forms.py
+
4
−
8
View file @
5d285f74
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
member/models.py
+
4
−
4
View file @
5d285f74
...
...
@@ -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
=
""
,
)
...
...
This diff is collapsed.
Click to expand it.
member/tests.py
+
18
−
18
View file @
5d285f74
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment