Commit 670a4d10 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

[types/fix] del_subject_relation argument is actually a relation_schema

parent 60b79c822230
......@@ -318,19 +318,19 @@ class EntitySchema(PermissionMixIn, ERSchema):
"""register the relation schema as possible object relation"""
self._object_relations[relation_schema] = relation_schema
@deprecation.argument_renamed(old_name="rtype", new_name="relation_type")
def del_subject_relation(self, relation_type) -> None:
@deprecation.argument_renamed(old_name="rtype", new_name="relation_schema")
def del_subject_relation(self, relation_schema: "RelationSchema") -> None:
try:
del self._subject_relations[relation_type]
del self._subject_relations[relation_schema]
clear_cache(self, "ordered_relations")
clear_cache(self, "meta_attributes")
except KeyError:
pass # XXX error should never pass silently
@deprecation.argument_renamed(old_name="rtype", new_name="relation_type")
def del_object_relation(self, relation_type) -> None:
if relation_type in self._object_relations:
del self._object_relations[relation_type]
def del_object_relation(self, relation_schema: "RelationSchema") -> None:
if relation_schema in self._object_relations:
del self._object_relations[relation_schema]
# IEntitySchema interface #################################################
......
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