From 0394adaf46b009153b486d20ae2830934c5d9d50 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 19 Aug 2020 10:49:14 +0200 Subject: [PATCH] *: fix general Linting errors --- e2e/test_sources_oauth.py | 2 +- passbook/flows/views.py | 9 +++++---- passbook/policies/types.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/e2e/test_sources_oauth.py b/e2e/test_sources_oauth.py index 01b29e056..5cbbccec8 100644 --- a/e2e/test_sources_oauth.py +++ b/e2e/test_sources_oauth.py @@ -81,7 +81,7 @@ class TestSourceOAuth(SeleniumTestCase): interval=5 * 100 * 1000000, start_period=1 * 100 * 1000000, ), - volumes={abspath(CONFIG_PATH): {"bind": "/config.yml", "mode": "ro",}}, + volumes={abspath(CONFIG_PATH): {"bind": "/config.yml", "mode": "ro"}}, ) while True: container.reload() diff --git a/passbook/flows/views.py b/passbook/flows/views.py index f2c5e1622..5553291c3 100644 --- a/passbook/flows/views.py +++ b/passbook/flows/views.py @@ -85,15 +85,16 @@ class FlowExecutorView(View): return self.handle_invalid_flow(exc) # We don't save the Plan after getting the next stage # as it hasn't been successfully passed yet - self.current_stage = self.plan.next() + next_stage = self.plan.next() + if not next_stage: + LOGGER.debug("f(exec): no more stages, flow is done.") + return self._flow_done() + self.current_stage = next_stage LOGGER.debug( "f(exec): Current stage", current_stage=self.current_stage, flow_slug=self.flow.slug, ) - if not self.current_stage: - LOGGER.debug("f(exec): no more stages, flow is done.") - return self._flow_done() stage_cls = self.current_stage.type() self.current_stage_view = stage_cls(self) self.current_stage_view.args = self.args diff --git a/passbook/policies/types.py b/passbook/policies/types.py index 29ab69146..da956c75e 100644 --- a/passbook/policies/types.py +++ b/passbook/policies/types.py @@ -32,7 +32,7 @@ class PolicyResult: """Small data-class to hold policy results""" passing: bool - messages: Tuple[str] + messages: Tuple[str, ...] def __init__(self, passing: bool, *messages: str): self.passing = passing