Publisher2 non-blocking warnings

Hi everyone!

We are currently in the middle of transitioning from tk-multi-publish to tk-multi-publish2 and I was wandering if there is a good/default way to implement warnings that are “non-blocking”. Currently in the validation step you can either block the publish or let it pass. But we would like to implement some sanity-checks that tell the user that something could be wrong but publishes just fine.
Is this possible?

Cheers,
Fabian

3 Likes

You can log a warning, but that won’t stop the validation from passing.

I guess you want the user to be able to state that they are happy to ignore the warning.
I have a solution though it is clunky.

In your plugin you could have the following:

    def validate(self, settings, item):
        if not item.local_properties.get("ignore_bad_stuff", False):
            self.logger.warning("bad stuff", extra={
                "action_button":{
                    "label": "Ignore",
                    "tooltip": "Ignore this warning",
                    "callback": self._ignore_warning,
                    "args": {"item": item}
                },
            })
            raise Exception("bad stuff")
        return True


    def _ignore_warning(self, item):
        item.local_properties["ignore_bad_stuff"] = True
        print("ignoring", item)

This will create an error in the publish log with an ignore button. Once you’ve pressed that it will pass next time you validate.

Maybe there is an even better way that I haven’t thought of.

2 Likes

Hi Philip!

Thanks for your answer and cool idea! :slight_smile: Unfortunately it is not quite what we are looking for. I’ve made a small mock-up to give you an idea about what we have in mind. Maybe it sparks some idea :slightly_smiling_face:
image

So there would be another button beside the green check mark that tells the user something might be wrong. Clicking on it would bring him to the right line in the logging view where the user get’s more information (and maybe in the best-case scenario a way to fix the issue).

Thanks anyway for your help!

Cheers,
Fabian

1 Like