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
6b896a69
Commit
6b896a69
authored
Oct 21, 2013
by
Don Mitchell
Committed by
David Baumgold
Oct 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use known translation if exists to get groupname
parent
ca4534f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
cms/djangoapps/auth/authz.py
+5
-0
No files found.
cms/djangoapps/auth/authz.py
View file @
6b896a69
...
@@ -10,6 +10,7 @@ from django.conf import settings
...
@@ -10,6 +10,7 @@ from django.conf import settings
from
xmodule.modulestore
import
Location
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.locator
import
CourseLocator
,
Locator
from
xmodule.modulestore.locator
import
CourseLocator
,
Locator
from
xmodule.modulestore.django
import
loc_mapper
# define a couple of simple roles, we just need ADMIN and EDITOR now for our purposes
# define a couple of simple roles, we just need ADMIN and EDITOR now for our purposes
...
@@ -35,7 +36,11 @@ def get_course_groupname_for_role(location, role):
...
@@ -35,7 +36,11 @@ def get_course_groupname_for_role(location, role):
if
isinstance
(
location
,
Location
):
if
isinstance
(
location
,
Location
):
groupnames
.
append
(
'{0}_{1}'
.
format
(
role
,
location
.
course
))
groupnames
.
append
(
'{0}_{1}'
.
format
(
role
,
location
.
course
))
elif
isinstance
(
location
,
CourseLocator
):
elif
isinstance
(
location
,
CourseLocator
):
old_location
=
loc_mapper
()
.
translate_locator_to_location
(
location
)
if
old_location
is
None
:
groupnames
.
append
(
'{0}_{1}'
.
format
(
role
,
location
.
as_old_location_course_id
))
groupnames
.
append
(
'{0}_{1}'
.
format
(
role
,
location
.
as_old_location_course_id
))
else
:
groupnames
.
append
(
'{0}_{1}'
.
format
(
role
,
old_location
.
course_id
))
for
groupname
in
groupnames
:
for
groupname
in
groupnames
:
if
Group
.
objects
.
filter
(
name
=
groupname
)
.
exists
():
if
Group
.
objects
.
filter
(
name
=
groupname
)
.
exists
():
...
...
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