views.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Casper-HC 作者: jamfit 项目源码 文件源码
def hipchat_configure_update():
    signed_token = flask.request.args.get('signed_request')
    installed_room = verify_jwt(signed_token)
    try:
        installed_room.jamf_auth = (
            flask.request.values.get('jamf_url'),
            flask.request.values.get('jamf_username'),
            flask.request.values.get('jamf_password')
        )
        db.session.commit()
    except:
        flask.flash('The service account could not be validated. Please verify the URL, username and password.', 'error')
    else:
        flask.flash('The service account has been validated and saved!', 'success')
        send_notification(
            installed_room.hipchat_token, installed_room.hipchat_room_id,
            '''<p><b>A Jamf Pro service account has been configured!</b></p>
            <p>You may now search your Jamf Pro server's inventory from this room.''',
            color='purple', notify=True
        )

    return flask.redirect(flask.url_for('hipchat_configure'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号