#NEWLINE# def form_valid( self , form ) : #NEWLINE# #INDENT# data = form . cleaned_data #NEWLINE# domain = data [ 'domain_base' ] #NEWLINE# domain_is_whitelisted = check_valid_tld ( domain ) #NEWLINE# if ( not domain_is_whitelisted ) : #NEWLINE# #INDENT# messages . info ( self . request , ( 'Sorry, but to limit the cost of running this service, we have not enabled searching this domain name (%s).' % data ) ) #NEWLINE# return HttpResponseRedirect ( resolve_url ( 'home' ) ) #NEWLINE# #UNINDENT# search_done = search_bing ( domain ) #NEWLINE# if ( not search_done ) : #NEWLINE# #INDENT# messages . info ( self . request , "This domain has already been requested today! Here is what we've gathered." ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# messages . info ( self . request , 'Gathering results now. They will be displayed shortly.' ) #NEWLINE# #UNINDENT# return HttpResponseRedirect ( resolve_url ( 'domain_result' , domain ) )