(key)
return outer
Set value of given key in settings.SESSION_COUNT_KEY to 0.
Set value of given key in settings.SESSION_COUNT_KEY to 0.
Set value of given key in settings . SESSION_COUNT_KEY to 0 .
def reset_count(key):
    """
    Set value of given key in settings.SESSION_COUNT_KEY to 0.
    """
    session_key = settings.SESSION_COUNT_KEY

    def outer(func):
        @wraps(func)
        def inner(request, **kwargs):

            if request.user.is_authenticated:
                # Get the count from sessions
                counts = request.session.get(session_key, {})
                counts[key] = 0
                request.session[session_key] = counts

            results = func(request, **kwargs)

            return results

        return inner

    return outer
def reset_count ( key ) : session_key = settings . SESSION_COUNT_KEY def outer ( func ) : @ wraps ( func ) def inner ( request , * * kwargs ) : if request . user . is_authenticated : # Get the count from sessions counts = request . session . get ( session_key , { } ) counts [ key ] = 0 request . session [ session_key ] = counts results = func ( request , * * kwargs ) return results return inner return outer