mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Update client/ayon_core/tools/publisher/window.py
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
parent
c557744f14
commit
e35f3a5941
1 changed files with 12 additions and 10 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue