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
ba030813
Commit
ba030813
authored
Aug 11, 2015
by
Akiva Leffert
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9260 from edx/aleffert/start-date-error
Show vaguer error message if using default start date
parents
1de9fc64
2632fd7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
lms/djangoapps/courseware/access_response.py
+8
-4
No files found.
lms/djangoapps/courseware/access_response.py
View file @
ba030813
...
...
@@ -3,6 +3,7 @@ This file contains all the classes used by has_access for error handling
"""
from
django.utils.translation
import
ugettext
as
_
from
xmodule.course_metadata_utils
import
DEFAULT_START_DATE
class
AccessResponse
(
object
):
...
...
@@ -85,10 +86,13 @@ class StartDateError(AccessError):
"""
def
__init__
(
self
,
start_date
):
error_code
=
"course_not_started"
developer_message
=
"Course does not start until {}"
.
format
(
start_date
)
user_message
=
_
(
"Course does not start until {}"
# pylint: disable=translation-of-non-string
.
format
(
"{:
%
B
%
d,
%
Y}"
.
format
(
start_date
)))
if
start_date
==
DEFAULT_START_DATE
:
developer_message
=
"Course has not started"
user_message
=
_
(
"Course has not started"
)
else
:
developer_message
=
"Course does not start until {}"
.
format
(
start_date
)
user_message
=
_
(
"Course does not start until {}"
# pylint: disable=translation-of-non-string
.
format
(
"{:
%
B
%
d,
%
Y}"
.
format
(
start_date
)))
super
(
StartDateError
,
self
)
.
__init__
(
error_code
,
developer_message
,
user_message
)
...
...
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