From 051256a3605445872bdde5cad005d21ac8e0fa10 Mon Sep 17 00:00:00 2001 From: fabiocaccamo Date: Tue, 11 Jun 2024 14:37:46 +0200 Subject: [PATCH] Remove unused decorator. --- robocjk/api/decorators.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/robocjk/api/decorators.py b/robocjk/api/decorators.py index 3734310..3f47236 100644 --- a/robocjk/api/decorators.py +++ b/robocjk/api/decorators.py @@ -24,7 +24,6 @@ DeepComponent, Font, Project, - StatusModel, ) @@ -263,27 +262,6 @@ def wrapper(request, *args, **kwargs): # return wrapper -def require_status(view_func): - @wraps(view_func) - @require_params(status="str") - def wrapper(request, *args, **kwargs): - params = kwargs["params"] - status_choices = StatusModel.STATUS_CHOICES_VALUES_LIST - status = params.get_str("status", choices=status_choices, default="") - if not status: - return ApiResponseBadRequest( - 'Invalid parameter "status", status value must be "{}".'.format( - '" or "'.join(status_choices) - ) - ) - # success - kwargs["status"] = status - return view_func(request, *args, **kwargs) - - wrapper.__dict__["require_status"] = True - return wrapper - - def require_atomic_element(**kwargs): # read decorator options select_related = kwargs.get("select_related", ["font", "locked_by"]) or []