Unicode changes to support QRF

fixing unit tests

fixing merge error

fixing xqueue submission issue with unicode url (trial 0.1)

fixing fotmats as commented upon

removing yaml file language selection

Unicode changes to support QRF

removed unnecessary pass in modulestore/init.py

fixing merge error

fixing fotmats as commented upon

removing yaml file language selection

fixing pep8 violations

- fixing pylint violations

pylint violation

fixing line spaces and formats

ignore pylint E1101

remove empty line

fixing pylint violations

 pep8 violations

bulk mail unicode/decode

fix migration error

fix pep8 just to push again

more unicode/decode
Final changes to comments and error messages.
This commit is contained in:
Jay Zoldak
2014-01-10 12:20:28 -05:00
parent 1ff4671b8f
commit bc30addfb9
31 changed files with 107 additions and 104 deletions

View File

@@ -343,7 +343,7 @@ def _dispatch(table, action, user, obj):
action)
return result
raise ValueError("Unknown action for object type '{0}': '{1}'".format(
raise ValueError(u"Unknown action for object type '{0}': '{1}'".format(
type(obj), action))

View File

@@ -321,10 +321,10 @@ def get_module_for_descriptor_internal(user, descriptor, field_data_cache, cours
org, course_num, run = course_id.split("/")
tags = [
"org:{0}".format(org),
"course:{0}".format(course_num),
"run:{0}".format(run),
"score_bucket:{0}".format(score_bucket)
u"org:{0}".format(org),
u"course:{0}".format(course_num),
u"run:{0}".format(run),
u"score_bucket:{0}".format(score_bucket)
]
if grade_bucket_type is not None:
@@ -443,7 +443,7 @@ def get_module_for_descriptor_internal(user, descriptor, field_data_cache, cours
make_psychometrics_data_update_handler(course_id, user, descriptor.location.url())
)
system.set('user_is_staff', has_access(user, descriptor.location, 'staff', course_id))
system.set(u'user_is_staff', has_access(user, descriptor.location, u'staff', course_id))
# make an ErrorDescriptor -- assuming that the descriptor's system is ok
if has_access(user, descriptor.location, 'staff', course_id):

View File

@@ -238,7 +238,7 @@ def index(request, course_id, chapter=None, section=None,
registered = registered_for_course(course, user)
if not registered:
# TODO (vshnayder): do course instructors need to be registered to see course?
log.debug('User %s tried to view course %s but is not enrolled' % (user, course.location.url()))
log.debug(u'User {0} tried to view course {1} but is not enrolled'.format(user, course.location.url()))
return redirect(reverse('about_course', args=[course.id]))
masq = setup_masquerade(request, staff_access)
@@ -249,8 +249,8 @@ def index(request, course_id, chapter=None, section=None,
course_module = get_module_for_descriptor(user, request, course, field_data_cache, course.id)
if course_module is None:
log.warning('If you see this, something went wrong: if we got this'
' far, should have gotten a course module for this user')
log.warning(u'If you see this, something went wrong: if we got this'
u' far, should have gotten a course module for this user')
return redirect(reverse('about_course', args=[course.id]))
if chapter is None:
@@ -424,9 +424,9 @@ def jump_to(request, course_id, location):
try:
(course_id, chapter, section, position) = path_to_location(modulestore(), course_id, location)
except ItemNotFoundError:
raise Http404("No data at this location: {0}".format(location))
raise Http404(u"No data at this location: {0}".format(location))
except NoPathToItem:
raise Http404("This location is not in any class: {0}".format(location))
raise Http404(u"This location is not in any class: {0}".format(location))
# choose the appropriate view (and provide the necessary args) based on the
# args provided by the redirect.