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
586f566b
Commit
586f566b
authored
Mar 26, 2013
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use advertised_start as a simple string
LMS Lighthouse [#297]
parent
a603f254
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
common/lib/xmodule/xmodule/course_module.py
+8
-4
common/lib/xmodule/xmodule/fields.py
+2
-0
No files found.
common/lib/xmodule/xmodule/course_module.py
View file @
586f566b
...
...
@@ -7,6 +7,8 @@ import requests
import
time
from
datetime
import
datetime
import
dateutil.parser
from
xmodule.modulestore
import
Location
from
xmodule.seq_module
import
SequenceDescriptor
,
SequenceModule
from
xmodule.timeparse
import
parse_time
...
...
@@ -150,7 +152,7 @@ class CourseFields(object):
enrollment_end
=
Date
(
help
=
"Date that enrollment for this class is closed"
,
scope
=
Scope
.
settings
)
start
=
Date
(
help
=
"Start time when this module is visible"
,
scope
=
Scope
.
settings
)
end
=
Date
(
help
=
"Date that this class ends"
,
scope
=
Scope
.
settings
)
advertised_start
=
String
OrDate
(
help
=
"Date that this course is advertised to start"
,
scope
=
Scope
.
settings
)
advertised_start
=
String
(
help
=
"Date that this course is advertised to start"
,
scope
=
Scope
.
settings
)
grading_policy
=
Object
(
help
=
"Grading policy definition for this class"
,
scope
=
Scope
.
content
)
show_calculator
=
Boolean
(
help
=
"Whether to show the calculator in this course"
,
default
=
False
,
scope
=
Scope
.
settings
)
display_name
=
String
(
help
=
"Display name for this module"
,
scope
=
Scope
.
settings
)
...
...
@@ -537,10 +539,12 @@ class CourseDescriptor(CourseFields, SequenceDescriptor):
announcement
=
self
.
announcement
if
announcement
is
not
None
:
announcement
=
to_datetime
(
announcement
)
if
self
.
advertised_start
is
None
or
isinstance
(
self
.
advertised_start
,
basestring
):
try
:
start
=
dateutil
.
parser
.
parse
(
self
.
advertised_start
)
except
(
ValueError
,
AttributeError
):
start
=
to_datetime
(
self
.
start
)
else
:
start
=
to_datetime
(
self
.
advertised_start
)
now
=
to_datetime
(
time
.
gmtime
())
return
announcement
,
start
,
now
...
...
common/lib/xmodule/xmodule/fields.py
View file @
586f566b
...
...
@@ -23,6 +23,8 @@ class Date(ModelType):
"""
if
field
is
None
:
return
field
elif
field
is
""
:
return
None
elif
isinstance
(
field
,
basestring
):
d
=
dateutil
.
parser
.
parse
(
field
)
return
d
.
utctimetuple
()
...
...
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