#NEWLINE# def get_daterange_or_404( start , end ) : #NEWLINE# #INDENT# 'Parse and validate a pair of YYYYMMDD date strings.' #NEWLINE# dates = DateForm ( data = { #NEWLINE# #INDENT# 'start' : start , #NEWLINE# 'end' : end , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( not dates . is_valid ( ) ) : #NEWLINE# #INDENT# logger . info ( 'Dates parsed were not valid.' ) #NEWLINE# raise http . Http404 #NEWLINE# #UNINDENT# return ( dates . cleaned_data [ 'start' ] , dates . cleaned_data [ 'end' ] )