Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
dd0cd57e
Commit
dd0cd57e
authored
Jul 12, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add date_of_birth
parent
456054a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
common/djangoapps/student/views.py
+9
-0
lms/templates/signup_modal.html
+17
-0
No files found.
common/djangoapps/student/views.py
View file @
dd0cd57e
...
...
@@ -31,6 +31,8 @@ from xmodule.course_module import CourseDescriptor
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
models
import
Registration
,
UserProfile
,
PendingNameChange
,
PendingEmailChange
,
CourseEnrollment
from
datetime
import
date
log
=
logging
.
getLogger
(
"mitx.student"
)
...
...
@@ -240,6 +242,13 @@ def create_account(request, post_override=None):
up
.
country
=
post_vars
[
'country'
]
up
.
gender
=
post_vars
[
'gender'
]
up
.
mailing_address
=
post_vars
[
'mailing_address'
]
date_fields
=
[
'date_of_birth__year'
,
'date_of_birth__month'
,
'date_of_birth__day'
]
if
all
(
len
(
post_vars
[
field
])
>
0
for
field
in
date_fields
):
up
.
date_of_birth
=
date
(
int
(
post_vars
[
'date_of_birth__year'
]),
int
(
post_vars
[
'date_of_birth__month'
]),
int
(
post_vars
[
'date_of_birth__day'
]))
up
.
save
()
# TODO (vshnayder): the LMS should probably allow signups without a particular course too
...
...
lms/templates/signup_modal.html
View file @
dd0cd57e
...
...
@@ -2,6 +2,7 @@
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%!
from
django_countries
.
countries
import
COUNTRIES
%
>
<
%!
from
student
.
models
import
UserProfile
%
>
<
%!
from
datetime
import
date
%
>
<section
id=
"signup-modal"
class=
"modal signup-modal"
>
<div
class=
"inner-wrapper"
>
...
...
@@ -41,6 +42,22 @@
<option
value=
"${code}"
>
${gender}
</option>
%endfor
</select>
<label>
Date of birth
</label>
<select
name=
'date_of_birth__month'
>
%for month in range(1,13):
<option
value=
"${month}"
>
${month}
</option>
%endfor
</select>
<select
name=
'date_of_birth__day'
>
%for day in range(1,32):
<option
value=
"${day}"
>
${day}
</option>
%endfor
</select>
<select
name=
'date_of_birth__year'
>
%for year in range(date.today().year,1899,-1):
<option
value=
"${year}"
>
${year}
</option>
%endfor
</select>
<label
class=
"terms-of-service"
>
<input
name=
"terms_of_service"
type=
"checkbox"
value=
"true"
>
I agree to the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment