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
03cdfa83
Commit
03cdfa83
authored
Mar 22, 2017
by
tasawernawaz
Committed by
Tasawer Nawaz
Mar 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make current user default course team admin
ECOM-7496
parent
c1225fe8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
course_discovery/apps/publisher/forms.py
+1
-0
course_discovery/static/js/publisher/organizations.js
+3
-2
No files found.
course_discovery/apps/publisher/forms.py
View file @
03cdfa83
...
@@ -165,6 +165,7 @@ class CustomCourseForm(CourseForm):
...
@@ -165,6 +165,7 @@ class CustomCourseForm(CourseForm):
)
.
order_by
(
Lower
(
'key'
))
)
.
order_by
(
Lower
(
'key'
))
self
.
declared_fields
[
'organization'
]
.
queryset
=
organizations
self
.
declared_fields
[
'organization'
]
.
queryset
=
organizations
self
.
declared_fields
[
'team_admin'
]
.
widget
.
attrs
=
{
'data-user'
:
user
.
id
}
super
(
CustomCourseForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
CustomCourseForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
if
edit_mode
:
if
edit_mode
:
...
...
course_discovery/static/js/publisher/organizations.js
View file @
03cdfa83
...
@@ -21,7 +21,8 @@ function loadAdminUsers(org_id) {
...
@@ -21,7 +21,8 @@ function loadAdminUsers(org_id) {
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
teamAdminDropDown
=
$
(
'#id_team_admin'
),
var
teamAdminDropDown
=
$
(
'#id_team_admin'
),
selectedTeamAdmin
=
$
(
'#id_team_admin option:selected'
).
val
(),
selectedTeamAdmin
=
$
(
'#id_team_admin option:selected'
).
val
(),
organizationInputType
=
$
(
'#id_organization'
).
attr
(
'type'
);
organizationInputType
=
$
(
'#id_organization'
).
attr
(
'type'
),
currentUser
=
teamAdminDropDown
.
data
(
'user'
);
teamAdminDropDown
.
empty
();
teamAdminDropDown
.
empty
();
if
(
organizationInputType
==
'hidden'
)
{
if
(
organizationInputType
==
'hidden'
)
{
...
@@ -32,7 +33,7 @@ function loadAdminUsers(org_id) {
...
@@ -32,7 +33,7 @@ function loadAdminUsers(org_id) {
}
}
$
.
each
(
data
.
results
,
function
(
i
,
user
)
{
$
.
each
(
data
.
results
,
function
(
i
,
user
)
{
if
(
selectedTeamAdmin
==
user
.
id
&&
organizationInputType
===
'hidden'
)
{
if
(
(
selectedTeamAdmin
==
user
.
id
&&
organizationInputType
===
'hidden'
)
||
currentUser
==
user
.
id
)
{
teamAdminDropDown
.
append
(
teamAdminDropDown
.
append
(
$
(
'<option selected="selected"> </option>'
).
val
(
user
.
id
).
html
(
user
.
full_name
)
$
(
'<option selected="selected"> </option>'
).
val
(
user
.
id
).
html
(
user
.
full_name
)
);
);
...
...
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