예제 #1
0
def delete_secret():
    logger.debug("Delete data from the database invoked")
    if request.json is None \
            or request.json is not None \
            and ("sid" not in request.json.keys() or "pin" not in request.json.keys()):
        logger.debug("There is some error in the request_body, status:400")
        return jsonify({
            'status': "Bad request",
            'message': 'invalid body url=' + request.url,
        }), 400
    else:
        result = request.json
        sid = result["sid"]
        pin = result["pin"]
        deleted = dblib.del_secret(sid, pin)
        if deleted:
            logger.debug("sid succesfully deleted: " + str(deleted) + " " +
                         str(sid))
            return jsonify(deleted_sid=sid)
        else:
            logger.debug("Such sid and/or pin does not exist")
            return jsonify({
                'status': "404: request",
                'message': "Such sid and/or pin does not exist"
            })
예제 #2
0
def del_secret(sid, pin):
    logger.debug("Delete data from database")
    if len(sid) > 0:
        del_id = dblib.del_secret(sid, pin)
        logger.debug("Sid succesfully deleted: " + str(del_id))
    else:
        print("Sid does not exist")
    logger.debug('End my super App')
    return jsonify(deleted_sid=sid)
예제 #3
0
def del_secret(sid, pin):
    logger.debug("Delete data from database")
    deleted = dblib.del_secret(sid, pin)
    if deleted:
        logger.debug("sid succesfully deleted: " +
                     str(deleted) + " " + str(sid))
        return jsonify(deleted_sid=sid)
    else:
        logger.debug("Such sid and/or pin does not exist")
        return jsonify({
            'status': "404: request",
            'message': 'Such sid and/or pin does not exist'})
예제 #4
0
def del_secret(sid, pin):
    logger.debug("Delete data from database")
    if len(sid) > 0:
        del_id = dblib.del_secret(sid, pin)
        logger.debug("Sid succesfully deleted: " + str(del_id))
        return jsonify(deleted_sid=sid)
    else:
        return jsonify({
            'status': "200: request",
            'message': 'pin or sid is wrong: ' + request.url,
        })

    logger.debug('End my super App')