Skip to content

Commit bec920d

Browse files
For #43560: Fix Publish() method not handling None vs. zero differently (#47)
1 parent 6b2e6dd commit bec920d

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

hooks/tk-multi-publish2/3dsmax.basic/publish_max_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ def publish(self, settings, item):
296296
publish_name = publisher.util.get_publish_name(path)
297297

298298
# extract the version number for publishing. use 1 if no version in path
299-
version_number = publisher.util.get_version_number(path) or 1
299+
# also make sure we are handling None and 0 differently
300+
version_number = publisher.util.get_version_number(path)
301+
if version_number is None:
302+
version_number = 1
300303

301304
# arguments for publish registration
302305
self.logger.info("Registering publish...")

hooks/tk-multi-publish2/houdini.basic/publish_houdini_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ def publish(self, settings, item):
296296
publish_name = publisher.util.get_publish_name(path)
297297

298298
# extract the version number for publishing. use 1 if no version in path
299-
version_number = publisher.util.get_version_number(path) or 1
299+
# also make sure we are handling None and 0 differently
300+
version_number = publisher.util.get_version_number(path)
301+
if version_number is None:
302+
version_number = 1
300303

301304
# arguments for publish registration
302305
self.logger.info("Registering publish...")

hooks/tk-multi-publish2/maya.basic/publish_maya_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ def publish(self, settings, item):
316316
publish_name = publisher.util.get_publish_name(path)
317317

318318
# extract the version number for publishing. use 1 if no version in path
319-
version_number = publisher.util.get_version_number(path) or 1
319+
# also make sure we are handling None and 0 differently
320+
version_number = publisher.util.get_version_number(path)
321+
if version_number is None:
322+
version_number = 1
320323

321324
# arguments for publish registration
322325
self.logger.info("Registering publish...")

hooks/tk-multi-publish2/nuke.basic/nuke_publish_script.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ def publish(self, settings, item):
296296
publish_name = publisher.util.get_publish_name(path)
297297

298298
# extract the version number for publishing. use 1 if no version in path
299-
version_number = publisher.util.get_version_number(path) or 1
299+
# also make sure we are handling None and 0 differently
300+
version_number = publisher.util.get_version_number(path)
301+
if version_number is None:
302+
version_number = 1
300303

301304
# arguments for publish registration
302305
self.logger.info("Registering publish...")

hooks/tk-multi-publish2/nuke.basic/nukestudio_publish_project.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ def publish(self, settings, item):
306306
publish_name = publisher.util.get_publish_name(path)
307307

308308
# extract the version number for publishing. use 1 if no version in path
309-
version_number = publisher.util.get_version_number(path) or 1
309+
# also make sure we are handling None and 0 differently
310+
version_number = publisher.util.get_version_number(path)
311+
if version_number is None:
312+
version_number = 1
310313

311314
# arguments for publish registration
312315
self.logger.info("Registering publish...")

hooks/tk-multi-publish2/photoshopcc.basic/publish_photoshop_document.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ def publish(self, settings, item):
315315
publish_name = publisher.util.get_publish_name(path)
316316

317317
# extract the version number for publishing. use 1 if no version in path
318-
version_number = publisher.util.get_version_number(path) or 1
318+
# also make sure we are handling None and 0 differently
319+
version_number = publisher.util.get_version_number(path)
320+
if version_number is None:
321+
version_number = 1
319322

320323
path_info = publisher.util.get_file_path_components(path)
321324
extension = path_info["extension"]

0 commit comments

Comments
 (0)