Commit aba9b3b9 by stv

Fix PEP8: E124 closing bracket does not match

visual indentation
parent 5a69fead
...@@ -24,7 +24,8 @@ def i_export_the_course(step): ...@@ -24,7 +24,8 @@ def i_export_the_course(step):
@step('I edit and enter bad XML$') @step('I edit and enter bad XML$')
def i_enter_bad_xml(step): def i_enter_bad_xml(step):
enter_xml_in_advanced_problem(step, enter_xml_in_advanced_problem(
step,
"""<problem><h1>Smallest Canvas</h1> """<problem><h1>Smallest Canvas</h1>
<p>You want to make the smallest canvas you can.</p> <p>You want to make the smallest canvas you can.</p>
<multiplechoiceresponse> <multiplechoiceresponse>
......
...@@ -14,23 +14,24 @@ class CourseMetadata(object): ...@@ -14,23 +14,24 @@ class CourseMetadata(object):
# The list of fields that wouldn't be shown in Advanced Settings. # The list of fields that wouldn't be shown in Advanced Settings.
# Should not be used directly. Instead the filtered_list method should be used if the field needs to be filtered # Should not be used directly. Instead the filtered_list method should be used if the field needs to be filtered
# depending on the feature flag. # depending on the feature flag.
FILTERED_LIST = ['xml_attributes', FILTERED_LIST = [
'start', 'xml_attributes',
'end', 'start',
'enrollment_start', 'end',
'enrollment_end', 'enrollment_start',
'tabs', 'enrollment_end',
'graceperiod', 'tabs',
'checklists', 'graceperiod',
'show_timezone', 'checklists',
'format', 'show_timezone',
'graded', 'format',
'hide_from_toc', 'graded',
'pdf_textbooks', 'hide_from_toc',
'user_partitions', 'pdf_textbooks',
'name', # from xblock 'user_partitions',
'tags', # from xblock 'name', # from xblock
'visible_to_staff_only' 'tags', # from xblock
'visible_to_staff_only',
] ]
@classmethod @classmethod
......
...@@ -2120,8 +2120,10 @@ class CodeResponse(LoncapaResponse): ...@@ -2120,8 +2120,10 @@ class CodeResponse(LoncapaResponse):
parsed = False parsed = False
if not parsed: if not parsed:
log.error("Unable to parse external grader message as valid" log.error(
" XML: score_msg['msg']=%s", msg "Unable to parse external grader message as valid"
" XML: score_msg['msg']=%s",
msg,
) )
return fail return fail
......
...@@ -152,16 +152,21 @@ class MongoConnection(object): ...@@ -152,16 +152,21 @@ class MongoConnection(object):
original_version (str or ObjectID): The id of a structure original_version (str or ObjectID): The id of a structure
block_key (BlockKey): The id of the block in question block_key (BlockKey): The id of the block in question
""" """
return [structure_from_mongo(structure) for structure in self.structures.find({ return [
'original_version': original_version, structure_from_mongo(structure)
'blocks': { for structure in self.structures.find({
'$elemMatch': { 'original_version': original_version,
'block_id': block_key.id, 'blocks': {
'block_type': block_key.type, '$elemMatch': {
'edit_info.update_version': {'$exists': True}, 'block_id': block_key.id,
} 'block_type': block_key.type,
} 'edit_info.update_version': {
})] '$exists': True,
},
},
},
})
]
def insert_structure(self, structure): def insert_structure(self, structure):
""" """
......
...@@ -54,10 +54,11 @@ class StudentModule(models.Model): ...@@ -54,10 +54,11 @@ class StudentModule(models.Model):
## Grade, and are we done? ## Grade, and are we done?
grade = models.FloatField(null=True, blank=True, db_index=True) grade = models.FloatField(null=True, blank=True, db_index=True)
max_grade = models.FloatField(null=True, blank=True) max_grade = models.FloatField(null=True, blank=True)
DONE_TYPES = (('na', 'NOT_APPLICABLE'), DONE_TYPES = (
('f', 'FINISHED'), ('na', 'NOT_APPLICABLE'),
('i', 'INCOMPLETE'), ('f', 'FINISHED'),
) ('i', 'INCOMPLETE'),
)
done = models.CharField(max_length=8, choices=DONE_TYPES, default='na', db_index=True) done = models.CharField(max_length=8, choices=DONE_TYPES, default='na', db_index=True)
created = models.DateTimeField(auto_now_add=True, db_index=True) created = models.DateTimeField(auto_now_add=True, db_index=True)
......
...@@ -115,13 +115,14 @@ class Command(BaseCommand): ...@@ -115,13 +115,14 @@ class Command(BaseCommand):
if make_eamap: if make_eamap:
credentials = "/C=US/ST=Massachusetts/O=Massachusetts Institute of Technology/OU=Client CA v1/CN=%s/emailAddress=%s" % (name, email) credentials = "/C=US/ST=Massachusetts/O=Massachusetts Institute of Technology/OU=Client CA v1/CN=%s/emailAddress=%s" % (name, email)
eamap = ExternalAuthMap(external_id=email, eamap = ExternalAuthMap(
external_email=email, external_id=email,
external_domain=mit_domain, external_email=email,
external_name=name, external_domain=mit_domain,
internal_password=password, external_name=name,
external_credentials=json.dumps(credentials), internal_password=password,
) external_credentials=json.dumps(credentials),
)
eamap.user = user eamap.user = user
eamap.dtsignup = datetime.datetime.now(UTC) eamap.dtsignup = datetime.datetime.now(UTC)
eamap.save() eamap.save()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment