Skip to content

Wrong string formatting causing image upload to crash in 3D Slicer #1601

@che85

Description

@che85

commit 055fdc2 introduces a bug

When using 3D Slicer and trying to upload an image to the server

Traceback (most recent call last):
  File "/Users/herzc/sources/py/MONAILabel/plugins/slicer/MONAILabel/MONAILabel.py", line 1376, in onUploadImage
    if not self.getPermissionForImageDataUpload():
  File "/Users/herzc/sources/py/MONAILabel/plugins/slicer/MONAILabel/MONAILabel.py", line 1363, in getPermissionForImageDataUpload
    _(
KeyError: 'server_url'

_(
"Source volume - without any additional patient information -"
" will be sent to remote data processing server: {server_url}.\n\n"
"Click 'OK' to proceed with the segmentation.\n"
"Click 'Cancel' to not upload any data and cancel segmentation.\n"
).format(self.serverUrl()),

if using string formatting, it should be

            _(
                "Source volume - without any additional patient information -"
                " will be sent to remote data processing server: {}.\n\n"
                "Click 'OK' to proceed with the segmentation.\n"
                "Click 'Cancel' to not upload any data and cancel segmentation.\n"
            ).format(self.serverUrl()),

I don't know if any other functionality is affected by that commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions