Draft: Fix messages that only worked for objects supplied as strings
Some error messages would only work if objects were supplied as strings. These would fail if objects were passed (as objects) that had already been deleted.
This commit is contained in:
@@ -170,20 +170,14 @@ def make_path_array(base_object, path_object, count=4,
|
||||
_err(translate("draft","No active document. Aborting."))
|
||||
return None
|
||||
|
||||
if isinstance(base_object, str):
|
||||
base_object_str = base_object
|
||||
|
||||
found, base_object = utils.find_object(base_object, doc)
|
||||
if not found:
|
||||
_err(translate("draft","Wrong input: base_object {} not in document.").format(base_object_str))
|
||||
_err(translate("draft","Wrong input: base_object not in document."))
|
||||
return None
|
||||
|
||||
if isinstance(path_object, str):
|
||||
path_object_str = path_object
|
||||
|
||||
found, path_object = utils.find_object(path_object, doc)
|
||||
if not found:
|
||||
_err(translate("draft","Wrong input: path_object not in document.").format(path_object_str))
|
||||
_err(translate("draft","Wrong input: path_object not in document."))
|
||||
return None
|
||||
|
||||
try:
|
||||
@@ -338,20 +332,14 @@ def make_path_twisted_array(base_object, path_object,
|
||||
_err(translate("draft","No active document. Aborting."))
|
||||
return None
|
||||
|
||||
if isinstance(base_object, str):
|
||||
base_object_str = base_object
|
||||
|
||||
found, base_object = utils.find_object(base_object, doc)
|
||||
if not found:
|
||||
_err(translate("draft","Wrong input: base_object not in document.").format(base_object_str))
|
||||
_err(translate("draft","Wrong input: base_object not in document."))
|
||||
return None
|
||||
|
||||
if isinstance(path_object, str):
|
||||
path_object_str = path_object
|
||||
|
||||
found, path_object = utils.find_object(path_object, doc)
|
||||
if not found:
|
||||
_err(translate("draft","Wrong input: path_object not in document.").format(path_object_str))
|
||||
_err(translate("draft","Wrong input: path_object not in document."))
|
||||
return None
|
||||
try:
|
||||
utils.type_check([(count, (int, float))],
|
||||
|
||||
Reference in New Issue
Block a user