-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traceback on automatic sticker printing in batch context #672
Conversation
auto_stickers_action = self.portal.bika_setup.getAutoPrintStickers() | ||
if transitioned and action == auto_stickers_action: | ||
self.request.form['uids'] = transitioned | ||
self.workflow_action_print_stickers() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for removing that backslash madness, which always looks to me like a huge regular expression. Finally, I can understand that little piece of code:)
However, looking at the return value return len(transitioned), dest
I see nowhere this dest
value set differently than None
. So I don't understand that logic what happens then. Should dest
be self.destination_url
?
We should really get away from using classes as multi-state-machines with implicit usage of instance variables, always gives me headaches...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, did not recall on that "dest" variable. Since the redirection is managed by workflow_action_print_stickers
, I think it should be totally safe to remove this dest
, but I will check if anyone is expecting this tuple return (I'd say that no one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, there is no sense to have this whole logic inside submitTransition
, especially because this workflow logic should not live inside bika_listing
imo, rather in workflow.<portal_type>.events.*
. I will take care of this soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this logic needs to go out from the listing code, agree.
I think so as well that other places handle that None
URL gracefully, at least the places I can remember. So I'm fine to let that in, ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then I will just do dest = self.destination_url
(its value is already assigned in workflow_action_print_stickers
) as a temporary solution until we get rid of this crap.
Description of the issue/feature this PR addresses
Traceback on rendering stickers from inside batch context on AR receive.
Linked issue: #671
Current behavior before PR
The following traceback appears in stickers preview:
Desired behavior after PR is merged
The PDF with the stickers correctly rendered for the received Analysis Requests is displayed
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.