#NEWLINE# @ require_POST #NEWLINE# @ login_required #NEWLINE# def create_apikey( request , user_id ) : #NEWLINE# #INDENT# 'Generate an API key for the given user; redirect to their edit page.' #NEWLINE# user = get_object_or_404 ( model . User , pk = user_id ) #NEWLINE# model . ApiKey . generate ( owner = user , user = request . user ) #NEWLINE# return redirect ( 'manage_user_edit' , user_id = user_id )