Fix up ErrorDescriptor._construct, and use in in ErrorDescriptor.from_json
This commit is contained in:
@@ -75,7 +75,7 @@ class ErrorDescriptor(JSONEditingDescriptor):
|
||||
|
||||
# real metadata stays in the content, but add a display name
|
||||
metadata = {'display_name': 'Error: ' + location.name}
|
||||
super(ErrorDescriptor, self).__init__(
|
||||
return ErrorDescriptor(
|
||||
system,
|
||||
definition,
|
||||
location=location,
|
||||
@@ -90,7 +90,7 @@ class ErrorDescriptor(JSONEditingDescriptor):
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_data, system, error_msg='Error not available'):
|
||||
return cls(
|
||||
return cls._construct(
|
||||
system,
|
||||
json.dumps(json_data, indent=4),
|
||||
error_msg,
|
||||
|
||||
@@ -101,8 +101,6 @@ class Location(_LocationBase):
|
||||
raise InsufficientSpecificationError(location)
|
||||
return loc
|
||||
|
||||
|
||||
|
||||
def __new__(_cls, loc_or_tag=None, org=None, course=None, category=None,
|
||||
name=None, revision=None):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user