entity_key should coalesce (entity.external_id or entity.id)

This commit is contained in:
Fabio Manganiello 2023-03-06 16:54:02 +01:00
parent 72c55c03f2
commit b9efa9fa30
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -105,7 +105,9 @@ if 'entity' not in Base.metadata:
"""
This method returns the "external" key of an entity.
"""
return (str(self.external_id or self.id), str(self.plugin))
return (str(self.external_id), str(self.plugin))
return (str(self.external_id or self.id), str(self.plugin))
def _serialize_value(self, col: ColumnProperty) -> Any:
val = getattr(self, col.key)