Skip to content

Commit

Permalink
Remove unused decorator.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Jun 11, 2024
1 parent 5313a25 commit 051256a
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions robocjk/api/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
DeepComponent,
Font,
Project,
StatusModel,
)


Expand Down Expand Up @@ -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 []
Expand Down

0 comments on commit 051256a

Please sign in to comment.