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