def control_apikeys_post_(request): form = request.web_input(**{'delete-api-keys': [], 'revoke-oauth2-consumers': []}) if form.get('add-api-key'): api.add_api_key(request.userid, form.get('add-key-description')) if form.get('delete-api-keys'): api.delete_api_keys(request.userid, form['delete-api-keys']) if form.get('revoke-oauth2-consumers'): oauth2.revoke_consumers_for_user(request.userid, form['revoke-oauth2-consumers']) raise HTTPSeeOther(location="/control/apikeys")
def control_apikeys_post_(request): form = request.web_input(**{'delete-api-keys': [], 'revoke-oauth2-consumers': []}) if form.get('add-api-key'): api.add_api_key(request.userid, form.get('add-key-description')) if form.get('delete-api-keys'): api.delete_api_keys(request.userid, form['delete-api-keys']) if form.get('revoke-oauth2-consumers'): oauth2.revoke_consumers_for_user(request.userid, form['revoke-oauth2-consumers']) raise HTTPSeeOther(location="/control/apikeys")
def POST(self): form = web.input(**{'delete-api-keys': [], 'revoke-oauth2-consumers': []}) if form.get('add-api-key'): api.add_api_key(self.user_id, form.get('add-key-description')) if form.get('delete-api-keys'): api.delete_api_keys(self.user_id, form['delete-api-keys']) if form.get('revoke-oauth2-consumers'): oauth2.revoke_consumers_for_user(self.user_id, form['revoke-oauth2-consumers']) raise web.seeother("/control/apikeys")
def POST(self): form = web.input(**{ 'delete-api-keys': [], 'revoke-oauth2-consumers': [] }) if form.get('add-api-key'): api.add_api_key(self.user_id, form.get('add-key-description')) if form.get('delete-api-keys'): api.delete_api_keys(self.user_id, form['delete-api-keys']) if form.get('revoke-oauth2-consumers'): oauth2.revoke_consumers_for_user(self.user_id, form['revoke-oauth2-consumers']) raise web.seeother("/control/apikeys")
def test_add_api_key(self): user = db_utils.create_user() api.add_api_key(user, "") self.assertEqual(1, api.get_api_keys(user).rowcount)