Fix template bug resulting in empty __post_init__ methods

This commit is contained in:
Nat Noordanus
2020-10-19 18:22:33 +02:00
committed by Basileus
parent fc90653ab1
commit bb646fe26f
4 changed files with 5 additions and 169 deletions

View File

@@ -54,7 +54,7 @@ class {{ message.py_name }}(betterproto.Message):
pass
{% endif %}
{% if message.deprecated or message.deprecated_fields %}
{% if message.deprecated or message.has_deprecated_fields %}
def __post_init__(self) -> None:
{% if message.deprecated %}
warnings.warn("{{ message.py_name }} is deprecated", DeprecationWarning)