#NEWLINE# def _build_iteration_revert_audit( iteration , revert_iteration , revert_before ) : #NEWLINE# #INDENT# iteration_audit = { #NEWLINE# #INDENT# 'iteration' : IterationSerializer ( iteration ) . data , #NEWLINE# 'change' : RevertChange . UNCHANGED . value , #NEWLINE# #UNINDENT# } #NEWLINE# if revert_before : #NEWLINE# #INDENT# if ( ( iteration . id == revert_iteration . id ) or ( iteration . start_datetime >= revert_iteration . start_datetime ) ) : #NEWLINE# #INDENT# iteration_audit [ 'change' ] = RevertChange . DELETED . value #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( iteration . id == revert_iteration . id ) : #NEWLINE# #INDENT# iteration_audit [ 'change' ] = RevertChange . REVERTED . value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( iteration . start_datetime > iteration . start_datetime ) : #NEWLINE# #INDENT# iteration_audit [ 'change' ] = RevertChange . DELETED . value #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return iteration_audit