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
85fa712f
Commit
85fa712f
authored
Aug 27, 2014
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change published_date to published_on
to make consistent with other edit info timestamps LMS-11184
parent
4878f6e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
16 deletions
+17
-16
cms/djangoapps/contentstore/views/item.py
+1
-1
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+8
-8
common/lib/xmodule/xmodule/modulestore/mongo/draft.py
+4
-3
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+3
-3
common/lib/xmodule/xmodule/xml_module.py
+1
-1
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
85fa712f
...
...
@@ -666,7 +666,7 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
"category"
:
xblock
.
category
,
"edited_on"
:
get_default_time_display
(
xblock
.
subtree_edited_on
)
if
xblock
.
subtree_edited_on
else
None
,
"published"
:
published
,
"published_on"
:
get_default_time_display
(
xblock
.
published_
date
)
if
xblock
.
published_date
else
None
,
"published_on"
:
get_default_time_display
(
xblock
.
published_
on
)
if
xblock
.
published_on
else
None
,
"studio_url"
:
xblock_studio_url
(
xblock
,
parent_xblock
),
"released_to_students"
:
datetime
.
now
(
UTC
)
>
xblock
.
start
,
"release_date"
:
release_date
,
...
...
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
85fa712f
...
...
@@ -235,14 +235,14 @@ class CachingDescriptorSystem(MakoDescriptorSystem):
edit_info
=
json_data
.
get
(
'edit_info'
)
# migrate published_by and published_
date
if edit_info isn't present
# migrate published_by and published_
on
if edit_info isn't present
if
not
edit_info
:
module
.
edited_by
=
module
.
edited_on
=
module
.
subtree_edited_on
=
\
module
.
subtree_edited_by
=
module
.
published_
date
=
None
module
.
subtree_edited_by
=
module
.
published_
on
=
None
raw_metadata
=
json_data
.
get
(
'metadata'
,
{})
# published_
date
was previously stored as a list of time components instead of a datetime
# published_
on
was previously stored as a list of time components instead of a datetime
if
raw_metadata
.
get
(
'published_date'
):
module
.
published_
date
=
datetime
(
*
raw_metadata
.
get
(
'published_date'
)[
0
:
6
])
.
replace
(
tzinfo
=
UTC
)
module
.
published_
on
=
datetime
(
*
raw_metadata
.
get
(
'published_date'
)[
0
:
6
])
.
replace
(
tzinfo
=
UTC
)
module
.
published_by
=
raw_metadata
.
get
(
'published_by'
)
# otherwise restore the stored editing information
else
:
...
...
@@ -250,7 +250,7 @@ class CachingDescriptorSystem(MakoDescriptorSystem):
module
.
edited_on
=
edit_info
.
get
(
'edited_on'
)
module
.
subtree_edited_on
=
edit_info
.
get
(
'subtree_edited_on'
)
module
.
subtree_edited_by
=
edit_info
.
get
(
'subtree_edited_by'
)
module
.
published_
date
=
edit_info
.
get
(
'published_date'
)
module
.
published_
on
=
edit_info
.
get
(
'published_date'
)
module
.
published_by
=
edit_info
.
get
(
'published_by'
)
# decache any computed pending field settings
...
...
@@ -1185,12 +1185,12 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
xblock
.
edited_by
=
user_id
xblock
.
subtree_edited_on
=
now
xblock
.
subtree_edited_by
=
user_id
if
not
hasattr
(
xblock
,
'published_
date
'
):
xblock
.
published_
date
=
None
if
not
hasattr
(
xblock
,
'published_
on
'
):
xblock
.
published_
on
=
None
if
not
hasattr
(
xblock
,
'published_by'
):
xblock
.
published_by
=
None
if
isPublish
:
xblock
.
published_
date
=
now
xblock
.
published_
on
=
now
xblock
.
published_by
=
user_id
# recompute (and update) the metadata inheritance tree which is cached
...
...
common/lib/xmodule/xmodule/modulestore/mongo/draft.py
View file @
85fa712f
...
...
@@ -12,10 +12,11 @@ import logging
from
opaque_keys.edx.locations
import
Location
from
xmodule.exceptions
import
InvalidVersionError
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
,
DuplicateItemError
,
DuplicateCourseError
from
xmodule.modulestore.exceptions
import
(
ItemNotFoundError
,
DuplicateItemError
,
DuplicateCourseError
,
InvalidBranchSetting
)
from
xmodule.modulestore.mongo.base
import
(
MongoModuleStore
,
MongoRevisionKey
,
as_draft
,
as_published
,
SORT_REVISION_FAVOR_DRAFT
MongoModuleStore
,
MongoRevisionKey
,
as_draft
,
as_published
,
SORT_REVISION_FAVOR_DRAFT
)
from
xmodule.modulestore.store_utilities
import
rewrite_nonportable_content_links
from
xmodule.modulestore.draft_and_published
import
UnsupportedRevisionError
,
DIRECT_ONLY_CATEGORIES
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
View file @
85fa712f
...
...
@@ -783,7 +783,7 @@ class TestMongoModuleStore(unittest.TestCase):
def
test_update_published_info
(
self
):
"""
Tests that published_
date
and published_by are set correctly
Tests that published_
on
and published_by are set correctly
"""
location
=
Location
(
'edX'
,
'toy'
,
'2012_Fall'
,
'html'
,
'test_html'
)
create_user
=
123
...
...
@@ -803,7 +803,7 @@ class TestMongoModuleStore(unittest.TestCase):
updated_component
=
self
.
draft_store
.
get_item
(
location
)
# Verify the time order and that publish_user caused publication
self
.
assertLessEqual
(
old_time
,
updated_component
.
published_
date
)
self
.
assertLessEqual
(
old_time
,
updated_component
.
published_
on
)
self
.
assertEqual
(
updated_component
.
published_by
,
publish_user
)
def
test_migrate_published_info
(
self
):
...
...
@@ -829,7 +829,7 @@ class TestMongoModuleStore(unittest.TestCase):
# Retrieve the block and verify its fields
component
=
self
.
draft_store
.
get_item
(
location
)
self
.
assertEqual
(
component
.
published_
date
,
published_date
)
self
.
assertEqual
(
component
.
published_
on
,
published_date
)
self
.
assertEqual
(
component
.
published_by
,
published_by
)
def
test_export_course_with_peer_component
(
self
):
...
...
common/lib/xmodule/xmodule/xml_module.py
View file @
85fa712f
...
...
@@ -124,7 +124,7 @@ class XmlDescriptor(XModuleDescriptor):
# import and export.
metadata_to_strip
=
(
'data_dir'
,
'tabs'
,
'grading_policy'
,
'published_by'
,
'published_date'
,
'tabs'
,
'grading_policy'
,
'discussion_blackouts'
,
# VS[compat] -- remove the below attrs once everything is in the CMS
'course'
,
'org'
,
'url_name'
,
'filename'
,
...
...
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