Commit 003abb18 by Calen Pennington

Fix up ErrorDescriptor._construct, and use in in ErrorDescriptor.from_json

parent eaec3a13
...@@ -75,7 +75,7 @@ class ErrorDescriptor(JSONEditingDescriptor): ...@@ -75,7 +75,7 @@ class ErrorDescriptor(JSONEditingDescriptor):
# real metadata stays in the content, but add a display name # real metadata stays in the content, but add a display name
metadata = {'display_name': 'Error: ' + location.name} metadata = {'display_name': 'Error: ' + location.name}
super(ErrorDescriptor, self).__init__( return ErrorDescriptor(
system, system,
definition, definition,
location=location, location=location,
...@@ -90,7 +90,7 @@ class ErrorDescriptor(JSONEditingDescriptor): ...@@ -90,7 +90,7 @@ class ErrorDescriptor(JSONEditingDescriptor):
@classmethod @classmethod
def from_json(cls, json_data, system, error_msg='Error not available'): def from_json(cls, json_data, system, error_msg='Error not available'):
return cls( return cls._construct(
system, system,
json.dumps(json_data, indent=4), json.dumps(json_data, indent=4),
error_msg, error_msg,
......
...@@ -101,8 +101,6 @@ class Location(_LocationBase): ...@@ -101,8 +101,6 @@ class Location(_LocationBase):
raise InsufficientSpecificationError(location) raise InsufficientSpecificationError(location)
return loc return loc
def __new__(_cls, loc_or_tag=None, org=None, course=None, category=None, def __new__(_cls, loc_or_tag=None, org=None, course=None, category=None,
name=None, revision=None): name=None, revision=None):
""" """
......
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