Update client/ayon_core/tools/publisher/window.py

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
Roy Nieterau 2025-05-22 23:14:11 +02:00 committed by GitHub
parent c557744f14
commit e35f3a5941
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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):