#NEWLINE# @ app . route ( '/profile/<profile_id>' , methods = [ 'POST' ] ) #NEWLINE# @ app . route ( '/profile/<profile_id>.json' , methods = [ 'POST' ] ) #NEWLINE# def create_new_user_profile( profile_id ) : #NEWLINE# #INDENT# userdict = { camel_to_snake_case ( v ) : v for ( k , v ) in request . json . iteritems ( ) } #NEWLINE# try : #NEWLINE# #INDENT# new_profile = create_profile_from_slug ( profile_id , userdict , db ) #NEWLINE# #UNINDENT# except EmailExistsError : #NEWLINE# #INDENT# abort_json ( 409 , 'That email already exists.' ) #NEWLINE# #UNINDENT# welcome_email . send_welcome_email ( new_profile . email , new_profile . given_name ) #NEWLINE# event_monitoring . new_user ( new_profile . url_slug , new_profile . given_name ) #NEWLINE# login_user ( new_profile , remember = True ) #NEWLINE# return json_resp_from_thing ( { #NEWLINE# #INDENT# 'user' : new_profile . dict_about ( ) , #NEWLINE# #UNINDENT# } )