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
fa2a82d7
Commit
fa2a82d7
authored
Mar 06, 2017
by
Waheed Ahmed
Committed by
Bill DeRusha
Mar 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments into publisher/api/serializers.py
parent
e1519ce0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
course_discovery/apps/publisher/api/serializers.py
+9
-1
No files found.
course_discovery/apps/publisher/api/serializers.py
View file @
fa2a82d7
...
...
@@ -54,6 +54,9 @@ class GroupUserSerializer(serializers.ModelSerializer):
fields
=
(
'id'
,
'full_name'
,)
def
get_user_full_name
(
self
,
obj
):
"""
Return full_name if exist otherwise username, to fix empty values in dropdown.
"""
return
obj
.
get_full_name
()
or
obj
.
username
...
...
@@ -103,6 +106,7 @@ class CourseRunSerializer(serializers.ModelSerializer):
lms_course_id
=
validated_data
.
get
(
'lms_course_id'
)
if
preview_url
:
# Change ownership to CourseTeam.
instance
.
course_run_state
.
change_owner_role
(
PublisherUserRole
.
CourseTeam
)
if
waffle
.
switch_is_active
(
'enable_publisher_email_notifications'
):
...
...
@@ -177,7 +181,10 @@ class CourseStateSerializer(serializers.ModelSerializer):
class
CourseRunStateSerializer
(
serializers
.
ModelSerializer
):
"""Serializer for `CourseRunState` model to change course-run workflow state. """
"""
Serializer for `CourseRunState` model to change course-run workflow state
or to mark preview as accepted.
"""
class
Meta
:
model
=
CourseRunState
...
...
@@ -208,6 +215,7 @@ class CourseRunStateSerializer(serializers.ModelSerializer):
)
elif
preview_accepted
:
# Mark preview accepted and change ownership to Publisher.
instance
.
preview_accepted
=
True
instance
.
owner_role
=
PublisherUserRole
.
Publisher
instance
.
owner_role_modified
=
timezone
.
now
()
...
...
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