Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-val
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-val
Commits
4894d064
Commit
4894d064
authored
May 17, 2017
by
muhammad-ammar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address feedback
parent
6a85bc9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
edxval/api.py
+3
-5
edxval/models.py
+2
-4
No files found.
edxval/api.py
View file @
4894d064
...
...
@@ -142,18 +142,16 @@ def update_video_status(edx_video_id, status):
video
.
save
()
def
get_course_video_image_url
(
course_id
=
None
,
edx_video_id
=
None
,
video_image
=
None
):
def
get_course_video_image_url
(
course_id
,
edx_video_id
):
"""
Returns course video image url or None if no image found
"""
try
:
if
video_image
is
None
:
video_image
=
CourseVideo
.
objects
.
get
(
course_id
=
course_id
,
video__edx_video_id
=
edx_video_id
)
.
video_image
video_image
=
CourseVideo
.
objects
.
get
(
course_id
=
course_id
,
video__edx_video_id
=
edx_video_id
)
.
video_image
return
video_image
.
image_url
()
except
ObjectDoesNotExist
:
return
None
return
video_image
.
image_url
()
def
update_video_image
(
edx_video_id
,
course_id
,
image_data
,
file_name
):
"""
...
...
edxval/models.py
View file @
4894d064
...
...
@@ -147,12 +147,10 @@ class CourseVideo(models.Model, ModelFactoryWithValidation):
def
image_url
(
self
):
"""
Return image url for a course video image.
Return image url for a course video image
or None if no image
.
"""
try
:
if
hasattr
(
self
,
'video_image'
)
:
return
self
.
video_image
.
image_url
()
except
VideoImage
.
DoesNotExist
:
pass
def
__unicode__
(
self
):
return
self
.
course_id
...
...
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