Commit 5e609c96 authored by François Ferry's avatar François Ferry
Browse files

fix: correct some bug introduce with typing

parent 18ae5afc7012
Pipeline #93157 failed with stages
in 4 minutes and 50 seconds
......@@ -570,9 +570,7 @@ class EntitySchema(PermissionMixIn, ERSchema):
"""return metadata's relation schema if this entity has the given
`metadata` field for the given `attribute` attribute
return self._subject_relations.get(
self.schema.relation_schema_for("%s_%s" % (attribute, metadata))
return self._subject_relations.get("%s_%s" % (attribute, metadata))
@deprecation.argument_renamed(old_name="attr", new_name="attribute")
def is_metadata(self, attribute) -> Optional[Tuple[str, str]]:
......@@ -1480,7 +1478,9 @@ class Schema:
] = []
for a_b, relation_definition in relation.relation_definitions.items():
if a_b[0] == old_name:
if a_b == (old_name, old_name):
to_rename.append((a_b, (new_name, new_name), relation_definition))
elif a_b[0] == old_name:
to_rename.append((a_b, (new_name, a_b[1]), relation_definition))
elif a_b[1] == old_name:
to_rename.append((a_b, (a_b[0], new_name), relation_definition))
Supports Markdown
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