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'))
评论列表
文章目录