def has_status(method=None, status='<STR_LIT>'):
if method is None:<EOL><INDENT>return partial(has_status, status=status)<EOL><DEDENT>@wraps(method)<EOL>def wrapper(self, *args, **kwargs):<EOL><INDENT>"""<STR_LIT>"""<EOL>if status != self.status:<EOL><INDENT>raise PIDInvalidAction()<EOL><DEDENT>return method(self, *args, **kwargs)<EOL><DEDENT>return wrapper<EOL>
Check that deposit has a defined status (default: draft).

    :param method: Function executed if record has a defined status.
        (Default: ``None``)
    :param status: Defined status to check. (Default: ``'draft'``)