Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Hsin-Yu Chien
edx-platform-release
Commits
dd0cd57e
Commit
dd0cd57e
authored
12 years ago
by
Matthew Mongeau
Browse files
Options
Downloads
Patches
Plain Diff
Add date_of_birth
parent
456054a2
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/djangoapps/student/views.py
+9
-0
9 additions, 0 deletions
common/djangoapps/student/views.py
lms/templates/signup_modal.html
+17
-0
17 additions, 0 deletions
lms/templates/signup_modal.html
with
26 additions
and
0 deletions
common/djangoapps/student/views.py
+
9
−
0
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
...
...
This diff is collapsed.
Click to expand it.
lms/templates/signup_modal.html
+
17
−
0
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
...
...
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