#NEWLINE# def is_active( self ) : #NEWLINE# #INDENT# if ( ( self . start_date is None ) and ( self . end_date is None ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# now = timezone . now ( ) #NEWLINE# if ( self . start_date and ( self . end_date is None ) ) : #NEWLINE# #INDENT# return ( now >= self . start_date ) #NEWLINE# #UNINDENT# if ( ( self . start_date is None ) and self . end_date ) : #NEWLINE# #INDENT# return ( now < self . end_date ) #NEWLINE# #UNINDENT# return ( self . start_date <= now < now . end_date )