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
131f136d
Commit
131f136d
authored
Apr 14, 2015
by
Zia Fazal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved code quality
parent
290ccc52
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
19 deletions
+27
-19
cms/djangoapps/contentstore/views/item.py
+2
-2
cms/envs/aws.py
+1
-1
cms/envs/common.py
+2
-3
lms/djangoapps/django_comment_client/base/tests.py
+1
-1
openedx/core/djangoapps/course_groups/management/commands/revert_workgroup.py
+19
-10
openedx/core/djangoapps/course_groups/tasks.py
+2
-2
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
131f136d
...
...
@@ -511,8 +511,8 @@ def _save_xblock(user, xblock, data=None, children_strings=None, metadata=None,
if
grader_type
is
not
None
:
result
.
update
(
CourseGradingModel
.
update_section_grader_type
(
xblock
,
grader_type
,
user
))
#
If publish is set to 'republish' and this item is not in direct only categories
and has previously been published,
# If publish is set to 'republish' and this item is not in direct only categories
# and has previously been published,
# then this item should be republished. This is used by staff locking to ensure that changing the draft
# value of the staff lock will also update the published version, but only at the unit level.
if
publish
==
'republish'
and
xblock
.
category
not
in
DIRECT_ONLY_CATEGORIES
:
...
...
cms/envs/aws.py
View file @
131f136d
...
...
@@ -63,7 +63,7 @@ BROKER_HEARTBEAT_CHECKRATE = 2
# Each worker should only fetch one message at a time
CELERYD_PREFETCH_MULTIPLIER
=
1
if
not
'SOUTH_MIGRATION_MODULES'
in
vars
()
and
not
'SOUTH_MIGRATION_MODULES'
in
globals
():
if
'SOUTH_MIGRATION_MODULES'
not
in
vars
()
and
'SOUTH_MIGRATION_MODULES'
not
in
globals
():
SOUTH_MIGRATION_MODULES
=
{}
# Skip djcelery migrations, since we don't use the database as the broker
...
...
cms/envs/common.py
View file @
131f136d
...
...
@@ -897,7 +897,7 @@ NOTIFICATION_STORE_PROVIDER = {
}
}
if
not
'SOUTH_MIGRATION_MODULES'
in
vars
()
and
not
'SOUTH_MIGRATION_MODULES'
in
globals
():
if
'SOUTH_MIGRATION_MODULES'
not
in
vars
()
and
'SOUTH_MIGRATION_MODULES'
not
in
globals
():
SOUTH_MIGRATION_MODULES
=
{}
SOUTH_MIGRATION_MODULES
.
update
({
...
...
@@ -948,4 +948,4 @@ NOTIFICATION_CHANNEL_PROVIDERS = {
# list all of the mappings of notification types to channel
NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS
=
{
'*'
:
'durable'
,
# default global mapping
}
\ No newline at end of file
}
lms/djangoapps/django_comment_client/base/tests.py
View file @
131f136d
...
...
@@ -23,7 +23,7 @@ from util.testing import UrlResetMixin
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
openedx.core.djangoapps.course_groups.cohorts
import
is_commentable_cohorted
,
add_cohort
,
add_user_to_cohort
,
is_user_in_cohort
from
openedx.core.djangoapps.course_groups.cohorts
import
is_commentable_cohorted
,
add_cohort
,
add_user_to_cohort
from
edx_notifications.lib.consumer
import
get_notifications_for_user
,
get_notifications_count_for_user
from
edx_notifications.startup
import
initialize
as
initialize_notifications
...
...
openedx/core/djangoapps/course_groups/management/commands/revert_workgroup.py
View file @
131f136d
from
django.core.management.base
import
BaseCommand
,
CommandError
"""
Django management command to Revert the multiple cohorts feature.
"""
from
django.core.management.base
import
BaseCommand
from
django.core.exceptions
import
MultipleObjectsReturned
from
optparse
import
make_option
...
...
@@ -8,7 +11,6 @@ from xmodule.modulestore.django import modulestore
from
xmodule.course_module
import
CourseDescriptor
from
openedx.core.djangoapps.course_groups.models
import
CourseUserGroup
from
openedx.core.djangoapps.course_groups.cohorts
import
(
get_cohort
,
get_cohort_by_name
,
add_cohort
,
add_user_to_cohort
,
...
...
@@ -18,12 +20,17 @@ from student.models import CourseEnrollment
class
Command
(
BaseCommand
):
"""
Command to revert multiple cohorts feature
"""
option_list
=
BaseCommand
.
option_list
+
(
make_option
(
'--fix'
,
make_option
(
'--fix'
,
action
=
'store_true'
,
dest
=
'fix'
,
default
=
False
,
help
=
'Apply possible fixes automatically'
),
help
=
'Apply possible fixes automatically'
),
)
help
=
'Revert the multiple cohorts feature.'
...
...
@@ -70,8 +77,10 @@ class Command(BaseCommand):
default_cohort
=
get_cohort_by_name
(
course
.
id
,
CourseUserGroup
.
default_cohort_name
)
except
CourseUserGroup
.
DoesNotExist
:
default_cohort
=
add_cohort
(
course
.
id
,
CourseUserGroup
.
default_cohort_name
)
self
.
stdout
.
write
(
'Default cohort "{}" created for course "{}"'
.
format
(
default_cohort
.
name
,
course
.
display_name
)
self
.
stdout
.
write
(
'Default cohort "{}" created for course "{}"'
.
format
(
default_cohort
.
name
,
course
.
display_name
)
)
add_user_to_cohort
(
default_cohort
,
user
.
username
)
self
.
stdout
.
write
(
...
...
@@ -92,13 +101,13 @@ class Command(BaseCommand):
if
options
[
'fix'
]:
user_cohorts
=
CourseUserGroup
.
objects
.
filter
(
course_id
=
course
.
id
,
users__id
=
user
.
id
)
.
all
()
user_cohort
=
user_cohorts
[
0
]
for
cohort
in
user_cohorts
[
1
:]:
remove_user_from_cohort
(
cohort
,
user
.
username
)
self
.
stdout
.
write
(
"User '{}' has been removed from cohort '{}' in course '{}'.
\n
"
.
format
(
user
.
username
,
cohort
.
name
,
course
.
display_name
)
self
.
stdout
.
write
(
"User '{}' has been removed from cohort '{}' in course '{}'.
\n
"
.
format
(
user
.
username
,
cohort
.
name
,
course
.
display_name
)
)
self
.
stdout
.
write
(
"User '{}' is now only in cohort '{}' in course '{}'.
\n
"
.
format
(
user
.
username
,
cohort
.
name
,
course
.
display_name
)
)
...
...
openedx/core/djangoapps/course_groups/tasks.py
View file @
131f136d
...
...
@@ -5,7 +5,7 @@ This file contains celery tasks for student course enrollment
from
celery.task
import
task
from
.models
import
CourseUserGroup
from
edx_notifications.lib.publisher
import
bulk_publish_notification_to_users
from
student.models
import
CourseEnrollment
import
logging
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -25,7 +25,7 @@ def publish_course_group_notification_task(course_group_id, notification_msg, ex
try
:
bulk_publish_notification_to_users
(
user_ids
,
notification_msg
,
exclude_user_ids
=
exclude_user_ids
)
except
Exception
,
ex
:
except
Exception
,
ex
:
# pylint: disable=broad-except
# Notifications are never critical, so we don't want to disrupt any
# other logic processing. So log and continue.
log
.
exception
(
ex
)
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