Skip to content

Commit e4a5e3a

Browse files
author
Ben Elam
committed
Clean up _handle_simple_input_form_generator
1 parent 5ad4a69 commit e4a5e3a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

orchestrator/workflow.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,25 +171,19 @@ def __repr__(self) -> str:
171171
def _handle_simple_input_form_generator(f: StateInputStepFunc, authorize_callback: Callable[[OIDCUserModel | None], bool] | None = None) -> StateInputFormGenerator:
172172
"""Processes f into a form generator and injects a pre-hook for user authorization"""
173173
def authorize_user_from_state(state: State) -> None:
174-
logger.error("authorize_user_from_state: called")
175174
user_model = state.pop("__process_user", None)
176175
if user_model is not None:
177176
user_model = cast(OIDCUserModel, user_model)
178-
else:
179-
logger.error("authorize_user_from_state: no user model")
180177

181178
if authorize_callback is not None:
182179
logger.error("authorize_user_from_state: callback found")
183180
authorize_callback(user_model)
184181
if not authorize_callback(user_model):
185-
logger.error("authorize_user_from_state: FORBIDDEN")
186182
#TODO not sure that step name is available here, but could put it on state?
187183
raise_status(HTTPStatus.FORBIDDEN, "User is not authorized to execute step")
188-
else:
189-
logger.error("authorize_user_from_state: no callback!")
190184

191185
if inspect.isgeneratorfunction(f):
192-
def generator_wrapper(state: State):
186+
def generator_wrapper(state: State) -> Any:
193187
authorize_user_from_state(state)
194188
return f(state)
195189

0 commit comments

Comments
 (0)