Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
64b01e9e
Commit
64b01e9e
authored
9 years ago
by
Omar Khan
Browse files
Options
Downloads
Plain Diff
Merge pull request #11694 from open-craft/omar/hide-tos
Registration: don't require terms of service if checkbox is hidden
parents
d46ea873
50b6bf27
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
+4
-0
4 additions, 0 deletions
common/djangoapps/student/views.py
openedx/core/djangoapps/user_api/tests/test_views.py
+10
-0
10 additions, 0 deletions
openedx/core/djangoapps/user_api/tests/test_views.py
with
14 additions
and
0 deletions
common/djangoapps/student/views.py
+
4
−
0
View file @
64b01e9e
...
...
@@ -1628,7 +1628,11 @@ def create_account_with_params(request, params):
not
do_external_auth
)
# Can't have terms of service for certain SHIB users, like at Stanford
registration_fields
=
getattr
(
settings
,
'
REGISTRATION_EXTRA_FIELDS
'
,
{})
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
(
"
SHIB_DISABLE_TOS
"
)
or
not
do_external_auth
or
...
...
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/user_api/tests/test_views.py
+
10
−
0
View file @
64b01e9e
...
...
@@ -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
):
response
=
self
.
client
.
post
(
self
.
url
,
...
...
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