def configure_before_handlers(app):
 @app.before_request
 def update_lastseen():
  'Updates `lastseen` before every reguest if the user is\n        authenticated.'
  if current_user.is_authenticated:
   current_user.lastseen = time_utcnow()
   db.session.add(current_user)
   db.session.commit()
 if app.config['REDIS_ENABLED']:
  @app.before_request
  def mark_current_user_online():
   if current_user.is_authenticated:
    mark_online(current_user.username)
   else:
    mark_online(request.remote_addr, guest=True)

def configure_before_handlers ( app ) : @ app . before_request def update_lastseen ( ) : if current_user . is_authenticated : current_user . lastseen = time_utcnow ( ) db . session . add ( current_user ) db . session . commit ( ) if app . config [ 'REDIS_ENABLED' ] : @ app . before_request def mark_current_user_online ( ) : if current_user . is_authenticated : mark_online ( current_user . username ) else : mark_online ( request . remote_addr , guest = True )
configures the before request handlers .