#NEWLINE# @ base . require_fully_signed_up #NEWLINE# def post( self ) : #NEWLINE# #INDENT# 'Handles POST requests.' #NEWLINE# title = self . payload . get ( 'title' ) #NEWLINE# category = self . payload . get ( 'category' ) #NEWLINE# objective = self . payload . get ( 'objective' ) #NEWLINE# language_code = self . payload . get ( 'language_code' ) #NEWLINE# if ( not title ) : #NEWLINE# #INDENT# raise self . InvalidInputException ( 'No title supplied.' ) #NEWLINE# #UNINDENT# if ( not self ) : #NEWLINE# #INDENT# raise self . InvalidInputException ( 'No category chosen.' ) #NEWLINE# #UNINDENT# if ( not language_code ) : #NEWLINE# #INDENT# raise self . InvalidInputException ( 'No language chosen.' ) #NEWLINE# #UNINDENT# new_exploration_id = exp_services . get_new_exploration_id ( ) #NEWLINE# exploration = exp_domain . Exploration . create_default_exploration ( new_exploration_id , title , category , objective = objective , language_code = language_code ) #NEWLINE# exp_services . save_new_exploration ( self . user_id , exploration ) #NEWLINE# self . render_json ( { #NEWLINE# #INDENT# EXPLORATION_ID_KEY : new_exploration_id , #NEWLINE# #UNINDENT# } )