#NEWLINE# def clean( self ) : #NEWLINE# #INDENT# cleaned_data = super ( AppPostForm , self ) . clean ( ) #NEWLINE# channel = cleaned_data . get ( 'channel' ) #NEWLINE# text = cleaned_data . get ( 'text' ) #NEWLINE# if ( len ( text ) > channel . max_length_msgs ) : #NEWLINE# #INDENT# msg = 'The length of the text is longer than %(max_length)s characters, which is %(channel)s message length limit.' #NEWLINE# raise forms . ValidationError ( _ ( msg ) , params = { #NEWLINE# #INDENT# 'max_length' : channel . max_length_msgs , #NEWLINE# 'channel' : channel . name , #NEWLINE# #UNINDENT# } )