Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
77a8cac9
Commit
77a8cac9
authored
Apr 21, 2017
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed created_by and reviewed status when run is published.
parent
6afded19
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
14 deletions
+9
-14
course_discovery/apps/publisher/models.py
+5
-1
course_discovery/apps/publisher/tests/test_model.py
+1
-1
course_discovery/apps/publisher/views.py
+2
-1
course_discovery/static/sass/publisher/tabs.scss
+0
-10
course_discovery/templates/publisher/course_detail/_widgets.html
+1
-1
No files found.
course_discovery/apps/publisher/models.py
View file @
77a8cac9
...
...
@@ -271,7 +271,11 @@ class CourseRun(TimeStampedModel, ChangedByMixin):
@property
def
created_by
(
self
):
return
self
.
history
.
order_by
(
'history_date'
)
.
first
()
.
history_user
# pylint: disable=no-member
history_user
=
self
.
history
.
order_by
(
'history_date'
)
.
first
()
.
history_user
# pylint: disable=no-member
if
history_user
:
return
history_user
.
get_full_name
()
or
history_user
.
username
return
@property
def
studio_url
(
self
):
...
...
course_discovery/apps/publisher/tests/test_model.py
View file @
77a8cac9
...
...
@@ -49,7 +49,7 @@ class CourseRunTests(TestCase):
history_object
.
history_user
=
user
history_object
.
save
()
self
.
assertEqual
(
self
.
course_run
.
created_by
,
user
)
self
.
assertEqual
(
self
.
course_run
.
created_by
,
user
.
get_full_name
()
)
def
test_studio_url
(
self
):
""" Verify that property returns studio url. """
...
...
course_discovery/apps/publisher/views.py
View file @
77a8cac9
...
...
@@ -728,7 +728,8 @@ def get_course_role_widgets_data(user, course, state_object, change_state_url, p
role_widget
[
'button_disabled'
]
=
True
if
course_role
.
role
in
roles
:
if
state_object
.
name
==
CourseStateChoices
.
Approved
and
course_role
.
role
==
state_object
.
approved_by_role
:
reviewed_states
=
[
CourseStateChoices
.
Approved
,
CourseRunStateChoices
.
Published
]
if
state_object
.
name
in
reviewed_states
and
course_role
.
role
==
state_object
.
approved_by_role
:
history_record
=
state_object
.
history
.
filter
(
name
=
CourseStateChoices
.
Approved
)
.
order_by
(
'-modified'
)
.
first
()
...
...
course_discovery/static/sass/publisher/tabs.scss
View file @
77a8cac9
...
...
@@ -141,13 +141,3 @@
display
:
block
;
}
}
#progress
{
max-width
:
100%
;
overflow-x
:
auto
;
.dataTables_wrapper
{
@include
padding-right
(
20px
);
width
:
120%
;
}
}
course_discovery/templates/publisher/course_detail/_widgets.html
View file @
77a8cac9
...
...
@@ -18,7 +18,7 @@
{% for course_run in course.course_runs %}
<div
class=
"layout-1t2t layout-reversed course-run-item"
>
<div
class=
"layout-col layout-col-a created-by"
>
{% blocktrans with created_date=course_run.created.date created_time=course_run.created.time created_by=course_run.created_by
.full_name
%}
{% blocktrans with created_date=course_run.created.date created_time=course_run.created.time created_by=course_run.created_by %}
Created {{ created_date }} at {{ created_time }} by {{ created_by }}
{% endblocktrans %}
</div>
...
...
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