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
4c8b257b
Commit
4c8b257b
authored
Oct 25, 2017
by
Tyler Hallada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OrgDynamicUpgradeDeadlineConfiguration model
parent
2fafa546
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
lms/djangoapps/courseware/admin.py
+1
-0
lms/djangoapps/courseware/migrations/0005_orgdynamicupgradedeadlineconfiguration.py
+29
-0
lms/djangoapps/courseware/models.py
+23
-0
No files found.
lms/djangoapps/courseware/admin.py
View file @
4c8b257b
...
...
@@ -8,4 +8,5 @@ admin.site.register(models.DynamicUpgradeDeadlineConfiguration, ConfigurationMod
admin
.
site
.
register
(
models
.
OfflineComputedGrade
)
admin
.
site
.
register
(
models
.
OfflineComputedGradeLog
)
admin
.
site
.
register
(
models
.
CourseDynamicUpgradeDeadlineConfiguration
,
KeyedConfigurationModelAdmin
)
admin
.
site
.
register
(
models
.
OrgDynamicUpgradeDeadlineConfiguration
,
KeyedConfigurationModelAdmin
)
admin
.
site
.
register
(
models
.
StudentModule
)
lms/djangoapps/courseware/migrations/0005_orgdynamicupgradedeadlineconfiguration.py
0 → 100644
View file @
4c8b257b
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.db.models.deletion
from
django.conf
import
settings
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
(
'courseware'
,
'0004_auto_20171010_1639'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'OrgDynamicUpgradeDeadlineConfiguration'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
verbose_name
=
'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'change_date'
,
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'Change date'
)),
(
'enabled'
,
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'Enabled'
)),
(
'org_id'
,
models
.
CharField
(
max_length
=
255
,
db_index
=
True
)),
(
'deadline_days'
,
models
.
PositiveSmallIntegerField
(
default
=
21
,
help_text
=
'Number of days a learner has to upgrade after content is made available'
)),
(
'opt_out'
,
models
.
BooleanField
(
default
=
False
,
help_text
=
'Disable the dynamic upgrade deadline for this organization.'
)),
(
'changed_by'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
editable
=
False
,
to
=
settings
.
AUTH_USER_MODEL
,
null
=
True
,
verbose_name
=
'Changed by'
)),
],
),
]
lms/djangoapps/courseware/models.py
View file @
4c8b257b
...
...
@@ -400,3 +400,26 @@ class CourseDynamicUpgradeDeadlineConfiguration(ConfigurationModel):
default
=
False
,
help_text
=
_
(
'Disable the dynamic upgrade deadline for this course run.'
)
)
class
OrgDynamicUpgradeDeadlineConfiguration
(
ConfigurationModel
):
"""
Per-org configuration for dynamic upgrade deadlines.
This model controls dynamic upgrade deadlines on a per-org level, allowing organizations to
have different deadlines or opt out of the functionality altogether.
"""
class
Meta
(
object
):
app_label
=
'courseware'
KEY_FIELDS
=
(
'org_id'
,)
org_id
=
models
.
CharField
(
max_length
=
255
,
db_index
=
True
)
deadline_days
=
models
.
PositiveSmallIntegerField
(
default
=
21
,
help_text
=
_
(
'Number of days a learner has to upgrade after content is made available'
)
)
opt_out
=
models
.
BooleanField
(
default
=
False
,
help_text
=
_
(
'Disable the dynamic upgrade deadline for this organization.'
)
)
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