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)

"""Provide a decorator based on the LockdownMiddleware.

This module provides a decorator that takes the same arguments as the
middleware, but allows more granular locking than the middleware.
"""
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.
