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
Group review task #25
Conversation
…ns for compatibility with multiple reviewing tasks
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.
Just one quibble from code review, although it looks like tests are breaking too (it's reporting that no emails are being triggered).
reviewers = self.page.current_workflow_task.reviewers | ||
if reviewers.filter(pk=self.reviewer.pk).exists(): | ||
try: | ||
actions = {action[0] for action in self.page.current_workflow_task.get_actions(self.page, user=None, reviewer=self.reviewer)} |
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.
If current_workflow_task
is defined for this page, but is something other than ReviewTask / GroupReviewTask, then its get_actions
method will not accept a reviewer
argument, and this will fail with a TypeError (which doesn't get caught). I think it's best to keep the type check in place here.
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.
I've added an except for the TypeError, would this work? I agree the type check works currently, but ideally I'd like to make review functionality usable by custom tasks via the mixin factored out in the next PR, #27. Otherwise I could check for inheriting from that mixin, I suppose?
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.
Sounds good - yep, I think that change is worth making in #27. I'm a bit wary about catching TypeError, as that could mask legitimate errors too - I guess the same is true to a lesser extent for AttributeError too, so it would be good to change that to an if self.page.current_workflow_task:
(assuming that's the case it's meant to be catching...)
I can confirm that tests pass when run against the Wagtail feature/workflow branch now that wagtail/wagtail#5894 is merged. |
Adds a
GroupReviewTask
analogous toGroupApprovalTask
in Wagtail core, email notifications, and tests for email notificationsRelies on wagtail/wagtail#5894