#NEWLINE# def clean( self ) : #NEWLINE# #INDENT# data = super ( CreateImageForm , self ) . clean ( ) #NEWLINE# image_file = data . get ( 'image_file' , None ) #NEWLINE# image_url = data . get ( 'copy_from' , None ) #NEWLINE# if ( ( not self ) and ( not image_file ) ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'A image or external image location must be specified.' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( image_url and image_file ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'Can not specify both image and external image location.' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return data