#NEWLINE# def clean( self ) : #NEWLINE# #INDENT# cleaned_data = super ( AddMonitorAction , self ) . clean ( ) #NEWLINE# type_opt = cleaned_data . get ( 'type' ) #NEWLINE# if ( type_opt in [ 'http' , 'https' ] ) : #NEWLINE# #INDENT# http_method_opt = cleaned_data . get ( 'http_method' ) #NEWLINE# url_path = cleaned_data . get ( 'url_path' ) #NEWLINE# expected_codes = cleaned_data . get ( 'expected_codes' ) #NEWLINE# if ( not http_method_opt ) : #NEWLINE# #INDENT# msg = _ ( 'Please choose a HTTP method' ) #NEWLINE# self . _errors [ 'http_method' ] = self . error_class ( [ msg ] ) #NEWLINE# #UNINDENT# if ( not url_path ) : #NEWLINE# #INDENT# msg = _ ( 'Please specify an URL' ) #NEWLINE# self . _errors [ 'url_path' ] = self . error_class ( [ msg ] ) #NEWLINE# #UNINDENT# if ( not expected_codes ) : #NEWLINE# #INDENT# msg = _ ( 'Please enter a single value (e.g. 200), a list of values (e.g. 200, 202), or range of values (e.g. 200-204)' ) #NEWLINE# self . _errors [ 'expected_codes' ] = self . error_class ( [ msg ] ) #NEWLINE# #UNINDENT# #UNINDENT# return cleaned_data