def must_not_be_rejected(func):

    @functools.wraps(func)
    def wrapped(*args, **kwargs):

        node = get_or_http_error(Node, kwargs.get('nid', kwargs.get('pid')), allow_deleted=True)
        if node.sanction and node.sanction.is_rejected:
            raise HTTPError(http.GONE, data=dict(
                message_long="This registration has been rejected"
            ))

        return func(*args, **kwargs)

    return wrapped
Ensures approval/disapproval requests can't reach Sanctions that have
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/project/decorators.py/must_not_be_rejected