Fix allow_name_translation logic (#97701)

This commit is contained in:
amitfin 2023-08-04 13:51:04 +03:00 committed by Franck Nijhof
parent 0617363f53
commit f066b4645a
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -61,8 +61,9 @@ def allow_name_translation(integration: Integration) -> bool:
"""Validate that the translation name is not the same as the integration name."""
# Only enforce for core because custom integrations can't be
# added to allow list.
return integration.core and (
integration.domain in ALLOW_NAME_TRANSLATION
return (
not integration.core
or integration.domain in ALLOW_NAME_TRANSLATION
or integration.quality_scale == "internal"
)