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
50b6bf27
Commit
50b6bf27
authored
Mar 01, 2016
by
Omar Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Registration: don't require terms of service if checkbox is hidden
Fixes test failures in
e4613749
parent
d46ea873
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
common/djangoapps/student/views.py
+4
-0
openedx/core/djangoapps/user_api/tests/test_views.py
+10
-0
No files found.
common/djangoapps/student/views.py
View file @
50b6bf27
...
@@ -1628,7 +1628,11 @@ def create_account_with_params(request, params):
...
@@ -1628,7 +1628,11 @@ def create_account_with_params(request, params):
not
do_external_auth
not
do_external_auth
)
)
# Can't have terms of service for certain SHIB users, like at Stanford
# Can't have terms of service for certain SHIB users, like at Stanford
registration_fields
=
getattr
(
settings
,
'REGISTRATION_EXTRA_FIELDS'
,
{})
tos_required
=
(
tos_required
=
(
registration_fields
.
get
(
'terms_of_service'
)
!=
'hidden'
or
registration_fields
.
get
(
'honor_code'
)
!=
'hidden'
)
and
(
not
settings
.
FEATURES
.
get
(
"AUTH_USE_SHIB"
)
or
not
settings
.
FEATURES
.
get
(
"AUTH_USE_SHIB"
)
or
not
settings
.
FEATURES
.
get
(
"SHIB_DISABLE_TOS"
)
or
not
settings
.
FEATURES
.
get
(
"SHIB_DISABLE_TOS"
)
or
not
do_external_auth
or
not
do_external_auth
or
...
...
openedx/core/djangoapps/user_api/tests/test_views.py
View file @
50b6bf27
...
@@ -1683,6 +1683,16 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, ApiTestCase):
...
@@ -1683,6 +1683,16 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, ApiTestCase):
}
}
)
)
@override_settings
(
REGISTRATION_EXTRA_FIELDS
=
{
"honor_code"
:
"hidden"
,
"terms_of_service"
:
"hidden"
})
def
test_register_hidden_honor_code_and_terms_of_service
(
self
):
response
=
self
.
client
.
post
(
self
.
url
,
{
"email"
:
self
.
EMAIL
,
"name"
:
self
.
NAME
,
"username"
:
self
.
USERNAME
,
"password"
:
self
.
PASSWORD
,
})
self
.
assertHttpOK
(
response
)
def
test_missing_fields
(
self
):
def
test_missing_fields
(
self
):
response
=
self
.
client
.
post
(
response
=
self
.
client
.
post
(
self
.
url
,
self
.
url
,
...
...
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