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
846e05cd
Commit
846e05cd
authored
May 20, 2016
by
Douglas Hall
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12509 from edx/hasnain-naveed/MAYN-230
MAYN-230 / Added 2 extra fields for registration
parents
1ee87c88
d5d51f32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
openedx/core/djangoapps/user_api/views.py
+84
-0
No files found.
openedx/core/djangoapps/user_api/views.py
View file @
846e05cd
...
@@ -160,12 +160,16 @@ class RegistrationView(APIView):
...
@@ -160,12 +160,16 @@ class RegistrationView(APIView):
DEFAULT_FIELDS
=
[
"email"
,
"name"
,
"username"
,
"password"
]
DEFAULT_FIELDS
=
[
"email"
,
"name"
,
"username"
,
"password"
]
EXTRA_FIELDS
=
[
EXTRA_FIELDS
=
[
"first_name"
,
"last_name"
,
"city"
,
"city"
,
"state"
,
"state"
,
"country"
,
"country"
,
"gender"
,
"gender"
,
"year_of_birth"
,
"year_of_birth"
,
"level_of_education"
,
"level_of_education"
,
"company"
,
"title"
,
"mailing_address"
,
"mailing_address"
,
"goals"
,
"goals"
,
"honor_code"
,
"honor_code"
,
...
@@ -632,6 +636,86 @@ class RegistrationView(APIView):
...
@@ -632,6 +636,86 @@ class RegistrationView(APIView):
required
=
required
required
=
required
)
)
def
_add_company_field
(
self
,
form_desc
,
required
=
False
):
"""Add a Company field to a form description.
Arguments:
form_desc: A form description
Keyword Arguments:
required (bool): Whether this field is required; defaults to False
"""
# Translators: This label appears above a field on the registration form
# which allows the user to input the Company
company_label
=
_
(
u"Company"
)
form_desc
.
add_field
(
"company"
,
label
=
company_label
,
required
=
required
)
def
_add_title_field
(
self
,
form_desc
,
required
=
False
):
"""Add a Title field to a form description.
Arguments:
form_desc: A form description
Keyword Arguments:
required (bool): Whether this field is required; defaults to False
"""
# Translators: This label appears above a field on the registration form
# which allows the user to input the Title
title_label
=
_
(
u"Title"
)
form_desc
.
add_field
(
"title"
,
label
=
title_label
,
required
=
required
)
def
_add_first_name_field
(
self
,
form_desc
,
required
=
False
):
"""Add a First Name field to a form description.
Arguments:
form_desc: A form description
Keyword Arguments:
required (bool): Whether this field is required; defaults to False
"""
# Translators: This label appears above a field on the registration form
# which allows the user to input the First Name
first_name_label
=
_
(
u"First Name"
)
form_desc
.
add_field
(
"first_name"
,
label
=
first_name_label
,
required
=
required
)
def
_add_last_name_field
(
self
,
form_desc
,
required
=
False
):
"""Add a Last Name field to a form description.
Arguments:
form_desc: A form description
Keyword Arguments:
required (bool): Whether this field is required; defaults to False
"""
# Translators: This label appears above a field on the registration form
# which allows the user to input the First Name
last_name_label
=
_
(
u"Last Name"
)
form_desc
.
add_field
(
"last_name"
,
label
=
last_name_label
,
required
=
required
)
def
_add_country_field
(
self
,
form_desc
,
required
=
True
):
def
_add_country_field
(
self
,
form_desc
,
required
=
True
):
"""Add a country field to a form description.
"""Add a country field to a form description.
...
...
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