def forum_is_unread(forum, forumsread, user):
 if (not user.is_authenticated):
  return False
 read_cutoff = (time_utcnow() - timedelta(days=flaskbb_config['TRACKER_LENGTH']))
 if (flaskbb_config['TRACKER_LENGTH'] == 0):
  return False
 if (forum and (forum.topic_count == 0)):
  return False
 if (forum.last_post_created < read_cutoff):
  return False
 if (forum and (not forumsread)):
  return (forum.last_post_created > read_cutoff)
 try:
  if (forum.last_post_created > forumsread.cleared):
   if (forum.last_post_created < forumsread.last_read):
    return False
 except TypeError:
  pass
 return (forum.last_post_created > forumsread.last_read)

def forum_is_unread ( forum , forumsread , user ) : if ( not user . is_authenticated ) : return False read_cutoff = ( time_utcnow ( ) - timedelta ( days = flaskbb_config [ 'TRACKER_LENGTH' ] ) ) if ( flaskbb_config [ 'TRACKER_LENGTH' ] == 0 ) : return False if ( forum and ( forum . topic_count == 0 ) ) : return False if ( forum . last_post_created < read_cutoff ) : return False if ( forum and ( not forumsread ) ) : return ( forum . last_post_created > read_cutoff ) try : if ( forum . last_post_created > forumsread . cleared ) : if ( forum . last_post_created < forumsread . last_read ) : return False except TypeError : pass return ( forum . last_post_created > forumsread . last_read )
checks if a forum is unread .