diff --git a/openpype/plugins/publish/validate_version.py b/openpype/plugins/publish/validate_version.py
index b91633430f..9cda4dae90 100644
--- a/openpype/plugins/publish/validate_version.py
+++ b/openpype/plugins/publish/validate_version.py
@@ -1,4 +1,5 @@
import pyblish.api
+from openpype.pipeline.publish import PublishValidationError
class ValidateVersion(pyblish.api.InstancePlugin):
@@ -20,11 +21,25 @@ class ValidateVersion(pyblish.api.InstancePlugin):
version = instance.data.get("version")
latest_version = instance.data.get("latestVersion")
- if latest_version is not None:
+ if latest_version is not None and int(version) <= int(latest_version):
+ # TODO: Remove full non-html version upon drop of old publisher
msg = (
- "Version `{0}` from instance `{1}` that you are trying to"
- " publish, already exists in the database. Version in"
- " database: `{2}`. Please version up your workfile to a higher"
- " version number than: `{2}`."
+ "Version '{0}' from instance '{1}' that you are "
+ " trying to publish is lower or equal to an existing version "
+ " in the database. Version in database: '{2}'."
+ "Please version up your workfile to a higher version number "
+ "than: '{2}'."
).format(version, instance.data["name"], latest_version)
- assert (int(version) > int(latest_version)), msg
+
+ msg_html = (
+ "Version {0} from instance {1} that you are "
+ " trying to publish is lower or equal to an existing version "
+ " in the database. Version in database: {2}.
"
+ "Please version up your workfile to a higher version number "
+ "than: {2}."
+ ).format(version, instance.data["name"], latest_version)
+ raise PublishValidationError(
+ title="Higher version of publish already exists",
+ message=msg,
+ description=msg_html
+ )