(func: Callable)
return wraps(func)(_decorator)
A decorator for functions that control the playback.
    Every control changes the views state and returns an empty response.
    At least mod privilege is required during voting.
A decorator for functions that control the playback.
    Every control changes the views state and returns an empty response.
    At least mod privilege is required during voting.
A decorator for functions that control the playback . Every control changes the views state and returns an empty response . At least mod privilege is required during voting .
def control(func: Callable) -> Callable:
    """A decorator for functions that control the playback.
    Every control changes the views state and returns an empty response.
    At least mod privilege is required during voting."""

    def _decorator(request: WSGIRequest) -> HttpResponse:
        if storage.get("voting_enabled") and not user_manager.has_controls(
            request.user
        ):
            return HttpResponseForbidden()
        response = func(request)
        musiq.update_state()
        if response is not None:
            return response
        return HttpResponse()

    return wraps(func)(_decorator)
def control ( func : Callable ) -> Callable : def _decorator ( request : WSGIRequest ) -> HttpResponse : if storage . get ( "voting_enabled" ) and not user_manager . has_controls ( request . user ) : return HttpResponseForbidden ( ) response = func ( request ) musiq . update_state ( ) if response is not None : return response return HttpResponse ( ) return wraps ( func ) ( _decorator )