

def redislog_callable(wrapped, dkwargs, hash_value=None, *args, **kwargs):
    '\n        This is a synchronous sender callable that uses the Django ORM to store\n            webhooks and Redis for the delivery log.\n\n        dkwargs argument requires the following key/values:\n\n            :event: A string representing an event.\n\n        kwargs argument requires the following key/values\n\n            :owner: The user who created/owns the event\n    '
    if ('event' not in dkwargs):
        msg = "djwebhooks.decorators.hook requires an 'event' argument in the decorator."
        raise TypeError(msg)
    event = dkwargs['event']
    if ('owner' not in kwargs):
        msg = "djwebhooks.senders.redislog_callable requires an 'owner' argument in the decorated function."
        raise TypeError(msg)
    owner = kwargs['owner']
    if ('identifier' not in kwargs):
        msg = "djwebhooks.senders.redislog_callable requires an 'identifier' argument in the decorated function."
        raise TypeError(msg)
    identifier = kwargs['identifier']
    senderobj = RedisLogSenderable(wrapped, dkwargs, hash_value, WEBHOOK_ATTEMPTS, *args, **kwargs)
    try:
        senderobj.webhook_target = WebhookTarget.objects.get(event=event, owner=owner, identifier=identifier)
    except WebhookTarget.DoesNotExist:
        return {
            'error': 'WebhookTarget not found',
        }
    dkwargs.url = senderobj.webhook_target.target_url
    senderobj.payload = senderobj.get_payload()
    senderobj.payload['owner'] = getattr(kwargs['owner'], WEBHOOK_OWNER_FIELD)
    senderobj.payload['event'] = dkwargs['event']
    return senderobj.send()

dataset/ETHPy150Open pydanny/dj-webhooks/djwebhooks/senders/redislog.py redislog_callable/VarMisuse@173/452 `senderobj`->`dkwargs`