Merge pull request #23380 from edx/logs-cleanup
Remove unnecessary logs.
This commit is contained in:
@@ -306,10 +306,7 @@ class LibraryContentModule(LibraryContentFields, XModule, StudioEditableModule):
|
||||
current user.
|
||||
"""
|
||||
for block_type, block_id in self.selected_children():
|
||||
child = self.runtime.get_block(self.location.course_key.make_usage_key(block_type, block_id))
|
||||
if child is None:
|
||||
logger.info("Child not found for %s %s", str(block_type), str(block_id))
|
||||
yield child
|
||||
yield self.runtime.get_block(self.location.course_key.make_usage_key(block_type, block_id))
|
||||
|
||||
def student_view(self, context):
|
||||
fragment = Fragment()
|
||||
|
||||
@@ -370,16 +370,10 @@ def _find_thread(request, course, discussion_id, thread_id):
|
||||
response_limit=request.GET.get("resp_limit")
|
||||
)
|
||||
except cc.utils.CommentClientRequestError:
|
||||
log.info(u"Discussion Error: Thread ID:{thread_id} not found for Discussion: {discussion_id}".format(
|
||||
thread_id=thread_id, discussion_id=discussion_id)
|
||||
)
|
||||
return None
|
||||
# Verify that the student has access to this thread if belongs to a course discussion module
|
||||
thread_context = getattr(thread, "context", "course")
|
||||
if thread_context == "course" and not utils.discussion_category_id_access(course, request.user, discussion_id):
|
||||
log.info(u'Discussion Error: Thread Context:{context} for thread: {thread}'.format(
|
||||
context=thread_context, thread=thread.__dict__)
|
||||
)
|
||||
return None
|
||||
|
||||
# verify that the thread belongs to the requesting student's group
|
||||
@@ -388,9 +382,6 @@ def _find_thread(request, course, discussion_id, thread_id):
|
||||
if is_commentable_divided(course.id, discussion_id, course_discussion_settings) and not is_moderator:
|
||||
user_group_id = get_group_id_for_user(request.user, course_discussion_settings)
|
||||
if getattr(thread, "group_id", None) is not None and user_group_id != thread.group_id:
|
||||
log.info(u"Discussion Error: user_group:{user_group} is not equal to thread_group:{thread_group}".format(
|
||||
user_group=user_group_id, thread_group=thread.group_id
|
||||
))
|
||||
return None
|
||||
|
||||
return thread
|
||||
|
||||
@@ -3,8 +3,6 @@ Django ORM model specifications for the User API application
|
||||
"""
|
||||
|
||||
|
||||
import logging
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.validators import RegexValidator
|
||||
from django.db import models
|
||||
@@ -33,8 +31,6 @@ from student.models import (
|
||||
)
|
||||
from util.model_utils import emit_setting_changed_event, get_changed_fields_dict
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class RetirementStateError(Exception):
|
||||
pass
|
||||
@@ -104,9 +100,6 @@ def post_save_callback(sender, **kwargs):
|
||||
"""
|
||||
|
||||
user_preference = kwargs["instance"]
|
||||
if user_preference.key == u'pref-lang':
|
||||
log.info(u"Updated the language for the user:{username} to {new}".format(
|
||||
username=user_preference.user.username, new=user_preference.value))
|
||||
emit_setting_changed_event(
|
||||
user_preference.user, sender._meta.db_table, user_preference.key,
|
||||
user_preference._old_value, user_preference.value # pylint: disable=protected-access
|
||||
|
||||
@@ -117,9 +117,6 @@ def update_user_preferences(requesting_user, update, user=None):
|
||||
# First validate each preference setting
|
||||
errors = {}
|
||||
serializers = {}
|
||||
if u'pref-lang' in update.keys():
|
||||
log.info(u"Updating site language to {pref_lang} for the user: {username}"
|
||||
.format(pref_lang=update['pref-lang'], username=user))
|
||||
for preference_key in update.keys():
|
||||
preference_value = update[preference_key]
|
||||
if preference_value is not None:
|
||||
@@ -149,7 +146,6 @@ def update_user_preferences(requesting_user, update, user=None):
|
||||
except Exception as error:
|
||||
raise _create_preference_update_error(preference_key, preference_value, error)
|
||||
else:
|
||||
log.info(u"Deleting language preference for the user: {username}".format(username=user))
|
||||
delete_user_preference(requesting_user, preference_key)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user