'Approve/Reject the status of pending entries'

@api.validate(operation_schema, description=description)
@api.response(201, model=pending_entry_list_schema)
@api.response(204, u'No    entries    modified')
@api.doc(parser=just_task_parser)
def put(self, session=None):

    args = filter_parser.parse_args()
    data = request.json
    approved = (data[u'operation'] == u'approve')
    task_name = args.get(u'task_name')
    pending_entries = []
    for entry in list_pending_entries(session, task_name=task_name):
        if (entry.approved is not approved):
            entry.approved = approved
            pending_entries.append(entry.to_dict())
    rsp = jsonify(pending_entries)
    rsp.status_code = (201 if pending_entries else 204)
    return rsp
