#NEWLINE# def chall_to_challb( chall , status ) : #NEWLINE# #INDENT# 'Return ChallengeBody from Challenge.' #NEWLINE# kwargs = { #NEWLINE# #INDENT# 'chall' : chall , #NEWLINE# 'uri' : ( chall . typ + '_uri' ) , #NEWLINE# 'status' : status , #NEWLINE# #UNINDENT# } #NEWLINE# if ( kwargs == messages . STATUS_VALID ) : #NEWLINE# #INDENT# kwargs . update ( { #NEWLINE# #INDENT# 'validated' : datetime . datetime . now ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return messages . ChallengeBody ( ** kwargs )