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
369c13cd
Commit
369c13cd
authored
Mar 06, 2017
by
mikedikan
Committed by
GitHub
Mar 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14614 from edx/mdikan/remove-deprecated-fields-on-apiconfig
Removing unused fields on ProgramApiConfig model
parents
dabda5ca
06a6d852
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
92 deletions
+69
-92
common/test/acceptance/fixtures/programs.py
+1
-8
openedx/core/djangoapps/programs/migrations/0011_auto_20170301_1844.py
+66
-0
openedx/core/djangoapps/programs/models.py
+2
-75
openedx/core/djangoapps/programs/tests/mixins.py
+0
-9
No files found.
common/test/acceptance/fixtures/programs.py
View file @
369c13cd
...
@@ -6,16 +6,9 @@ from common.test.acceptance.fixtures.config import ConfigModelFixture
...
@@ -6,16 +6,9 @@ from common.test.acceptance.fixtures.config import ConfigModelFixture
class
ProgramsConfigMixin
(
object
):
class
ProgramsConfigMixin
(
object
):
"""Mixin providing a method used to configure the programs feature."""
"""Mixin providing a method used to configure the programs feature."""
def
set_programs_api_configuration
(
self
,
is_enabled
=
False
,
api_version
=
1
):
def
set_programs_api_configuration
(
self
,
is_enabled
=
False
):
"""Dynamically adjusts the Programs config model during tests."""
"""Dynamically adjusts the Programs config model during tests."""
# Update these paramters once fields are removed from model
ConfigModelFixture
(
'/config/programs'
,
{
ConfigModelFixture
(
'/config/programs'
,
{
'enabled'
:
is_enabled
,
'enabled'
:
is_enabled
,
'api_version_number'
:
api_version
,
'cache_ttl'
:
0
,
'marketing_path'
:
'/foo'
,
'marketing_path'
:
'/foo'
,
'enable_student_dashboard'
:
is_enabled
,
'enable_certification'
:
is_enabled
,
'program_listing_enabled'
:
is_enabled
,
'program_details_enabled'
:
is_enabled
,
})
.
install
()
})
.
install
()
openedx/core/djangoapps/programs/migrations/0011_auto_20170301_1844.py
0 → 100644
View file @
369c13cd
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'programs'
,
'0010_auto_20170204_2332'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'api_version_number'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'authoring_app_css_path'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'authoring_app_js_path'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'cache_ttl'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'enable_certification'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'enable_student_dashboard'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'enable_studio_tab'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'internal_service_url'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'max_retries'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'program_details_enabled'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'program_listing_enabled'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'public_service_url'
,
),
migrations
.
RemoveField
(
model_name
=
'programsapiconfig'
,
name
=
'xseries_ad_enabled'
,
),
]
openedx/core/djangoapps/programs/models.py
View file @
369c13cd
...
@@ -9,18 +9,10 @@ from config_models.models import ConfigurationModel
...
@@ -9,18 +9,10 @@ from config_models.models import ConfigurationModel
class
ProgramsApiConfig
(
ConfigurationModel
):
class
ProgramsApiConfig
(
ConfigurationModel
):
"""
"""
DEPRECATED. To be removed as part of ECOM-5136
.
This model no longer fronts an API, but now sets a few config-related values for the idea of programs in general
.
Manages configuration for connecting to the Programs service and using its API
.
A rename to ProgramsConfig would be more accurate, but costly in terms of developer time
.
"""
"""
OAUTH2_CLIENT_NAME
=
'programs'
CACHE_KEY
=
'programs.api.data'
API_NAME
=
'programs'
api_version_number
=
models
.
IntegerField
(
verbose_name
=
_
(
"API Version"
))
internal_service_url
=
models
.
URLField
(
verbose_name
=
_
(
"Internal Service URL"
),
blank
=
True
)
public_service_url
=
models
.
URLField
(
verbose_name
=
_
(
"Public Service URL"
),
blank
=
True
)
marketing_path
=
models
.
CharField
(
marketing_path
=
models
.
CharField
(
max_length
=
255
,
max_length
=
255
,
...
@@ -29,68 +21,3 @@ class ProgramsApiConfig(ConfigurationModel):
...
@@ -29,68 +21,3 @@ class ProgramsApiConfig(ConfigurationModel):
'Path used to construct URLs to programs marketing pages (e.g., "/foo").'
'Path used to construct URLs to programs marketing pages (e.g., "/foo").'
)
)
)
)
authoring_app_js_path
=
models
.
CharField
(
verbose_name
=
_
(
"Path to authoring app's JS"
),
max_length
=
255
,
blank
=
True
,
help_text
=
_
(
"This value is required in order to enable the Studio authoring interface."
)
)
authoring_app_css_path
=
models
.
CharField
(
verbose_name
=
_
(
"Path to authoring app's CSS"
),
max_length
=
255
,
blank
=
True
,
help_text
=
_
(
"This value is required in order to enable the Studio authoring interface."
)
)
cache_ttl
=
models
.
PositiveIntegerField
(
verbose_name
=
_
(
"Cache Time To Live"
),
default
=
0
,
help_text
=
_
(
"Specified in seconds. Enable caching by setting this to a value greater than 0."
)
)
enable_student_dashboard
=
models
.
BooleanField
(
verbose_name
=
_
(
"Enable Student Dashboard Displays"
),
default
=
False
)
enable_studio_tab
=
models
.
BooleanField
(
verbose_name
=
_
(
"Enable Studio Authoring Interface"
),
default
=
False
)
enable_certification
=
models
.
BooleanField
(
verbose_name
=
_
(
"Enable Program Certificate Generation"
),
default
=
False
)
max_retries
=
models
.
PositiveIntegerField
(
verbose_name
=
_
(
"Maximum Certification Retries"
),
default
=
11
,
# This gives about 30 minutes wait before the final attempt
help_text
=
_
(
"When making requests to award certificates, make at most this many attempts "
"to retry a failing request."
)
)
xseries_ad_enabled
=
models
.
BooleanField
(
verbose_name
=
_
(
"Do we want to show xseries program advertising"
),
default
=
False
)
program_listing_enabled
=
models
.
BooleanField
(
verbose_name
=
_
(
"Do we want to show program listing page"
),
default
=
False
)
program_details_enabled
=
models
.
BooleanField
(
verbose_name
=
_
(
"Do we want to show program details pages"
),
default
=
False
)
openedx/core/djangoapps/programs/tests/mixins.py
View file @
369c13cd
...
@@ -5,17 +5,8 @@ from openedx.core.djangoapps.programs.models import ProgramsApiConfig
...
@@ -5,17 +5,8 @@ from openedx.core.djangoapps.programs.models import ProgramsApiConfig
class
ProgramsApiConfigMixin
(
object
):
class
ProgramsApiConfigMixin
(
object
):
"""Utilities for working with Programs configuration during testing."""
"""Utilities for working with Programs configuration during testing."""
# Update these paramters once fields are removed from model
DEFAULTS
=
{
DEFAULTS
=
{
'enabled'
:
True
,
'enabled'
:
True
,
'api_version_number'
:
1
,
'internal_service_url'
:
'http://internal.programs.org/'
,
'public_service_url'
:
'http://public.programs.org/'
,
'cache_ttl'
:
0
,
'enable_studio_tab'
:
True
,
'enable_certification'
:
True
,
'program_listing_enabled'
:
True
,
'program_details_enabled'
:
True
,
'marketing_path'
:
'foo'
,
'marketing_path'
:
'foo'
,
}
}
...
...
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