#NEWLINE# def clean( self ) : #NEWLINE# #INDENT# cleaned_data = super ( SaleForm , self ) . clean ( ) #NEWLINE# discount_type = cleaned_data [ 'type' ] #NEWLINE# value = cleaned_data [ 'value' ] #NEWLINE# if ( ( discount_type == Sale . PERCENTAGE ) and ( value > 100 ) ) : #NEWLINE# #INDENT# self . add_error ( 'value' , pgettext_lazy ( 'sale error' , 'Sale cannot exceed 100%' ) ) #NEWLINE# #UNINDENT# return self