from django.utils.decorators import decorator_from_middleware_with_args

from lockdown.middleware import LockdownMiddleware


def lockdown(*args, **kwargs):
    """Define a decorator based on the LockdownMiddleware.

    This decorator takes the same arguments as the middleware, but allows a
    more granular locking than the middleware.
    """
    return decorator_from_middleware_with_args(LockdownMiddleware)(*args,
                                                                   **kwargs)

from django.utils.decorators import decorator_from_middleware_with_args

from lockdown.middleware import LockdownMiddleware

lockdown = decorator_from_middleware_with_args(LockdownMiddleware)

Remove wrapping of decorator in a func
Remove wrapping of decorator in a func

Growing older, growing wiser ...
This removes the unnecesary wrapping of the decorator in a function
introduced in e4a04c6, as it's not necessary and is less performant than
without.

  from django.utils.decorators import decorator_from_middleware_with_args
  
  from lockdown.middleware import LockdownMiddleware
  
+ lockdown = decorator_from_middleware_with_args(LockdownMiddleware)
  
- def lockdown(*args, **kwargs):
-     """Define a decorator based on the LockdownMiddleware.
- 
-     This decorator takes the same arguments as the middleware, but allows a
-     more granular locking than the middleware.
-     """
-     return decorator_from_middleware_with_args(LockdownMiddleware)(*args,
-                                                                    **kwargs)
- 
Remove wrapping of decorator in a func
## Code Before:
from django.utils.decorators import decorator_from_middleware_with_args

from lockdown.middleware import LockdownMiddleware


def lockdown(*args, **kwargs):
    """Define a decorator based on the LockdownMiddleware.

    This decorator takes the same arguments as the middleware, but allows a
    more granular locking than the middleware.
    """
    return decorator_from_middleware_with_args(LockdownMiddleware)(*args,
                                                                   **kwargs)

## Instruction:
Remove wrapping of decorator in a func
## Code After:
from django.utils.decorators import decorator_from_middleware_with_args

from lockdown.middleware import LockdownMiddleware

lockdown = decorator_from_middleware_with_args(LockdownMiddleware)
