From e35f3a59412feddc977e04390645abd79a2c282c Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 22 May 2025 23:14:11 +0200 Subject: [PATCH] Update client/ayon_core/tools/publisher/window.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/publisher/window.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/client/ayon_core/tools/publisher/window.py b/client/ayon_core/tools/publisher/window.py index 4932b578e2..523281e193 100644 --- a/client/ayon_core/tools/publisher/window.py +++ b/client/ayon_core/tools/publisher/window.py @@ -842,16 +842,18 @@ class PublisherWindow(QtWidgets.QDialog): def _start_publish_preflight(self) -> bool: # Validate comment length comment_def = self._controller.get_comment_def() - if comment_def.minimum_chars_required: - char_count = len(self._comment_input.text()) - if char_count < comment_def.minimum_chars_required: - self._overlay_object.add_message( - "Please enter a comment of at least " - f"{comment_def.minimum_chars_required} characters", - message_type="error" - ) - self._invalidate_comment_field() - return False + char_count = len(self._comment_input.text()) + if ( + comment_def.minimum_chars_required + and char_count < comment_def.minimum_chars_required + ): + self._overlay_object.add_message( + "Please enter a comment of at least " + f"{comment_def.minimum_chars_required} characters", + message_type="error" + ) + self._invalidate_comment_field() + return False return True def _invalidate_comment_field(self):