Fix template bug resulting in empty __post_init__ methods

This commit is contained in:
Nat Noordanus
2021-04-02 10:13:08 +11:00
committed by Basileus
parent fc90653ab1
commit bb646fe26f
4 changed files with 5 additions and 169 deletions
+1 -1
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)