#NEWLINE# def clean( self , value ) : #NEWLINE# #INDENT# value = super ( FileBrowseFormField , self ) . clean ( value ) #NEWLINE# if ( value == '' ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# file_extension = os . path . splitext ( value ) [ 1 ] . lower ( ) . split ( '?' ) [ 0 ] #NEWLINE# if ( self . extensions and ( not ( file_extension in self . extensions ) ) ) : #NEWLINE# #INDENT# raise forms . ValidationError ( ( self . error_messages [ 'extension' ] % { #NEWLINE# #INDENT# 'ext' : file_extension , #NEWLINE# 'allowed' : ', ' . join ( self . extensions ) , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# return value