'Delete pending entries'

@api.response(200, model=base_message_schema)
@api.doc(parser=filter_parser)
def delete(self, session=None):

    args = filter_parser.parse_args()
    task_name = args.get(u'task_name')
    approved = args.get(u'approved')
    deleted = session.query(PendingEntry)
    if task_name:
        deleted = deleted.filter((PendingEntry.task_name == task_name))
    if approved:
        deleted = deleted.filter((PendingEntry.approved == approved))
    deleted = deleted.delete()
    return success_response(u'deleted    %s    pending    entries'.format(deleted))
