def dispatch_aliases():
 app = current_app
 aliases_map = app.config.get('ALIASES_MAP')
 if (aliases_map and (request.path in aliases_map)):
  alias = aliases_map[request.path]
  status = alias.get('status', 200)
  if (alias['alias_type'] == 'endpoint'):
   endpoint = alias['to']
   if (alias.get('action') == 'redirect'):
    return redirect(url_for(endpoint, **request.args))
   else:
    return app.process_response(app.make_response(app.view_functions[endpoint]()))
  elif (alias['alias_type'] == 'long_slug'):
   long_slug = alias['to']
   if (alias.get('action') == 'redirect'):
    return redirect(long_slug)
   else:
    endpoint = route_from(long_slug)[0]
    return app.process_response(app.make_response(app.view_functions[endpoint]()))
  elif (alias['alias_type'] == 'url'):
   return redirect(alias['to'])
  elif (alias['alias_type'] == 'string'):
   return (render_template_string(alias['to']), status)
  elif (alias['alias_type'] == 'template'):
   return (render_template(alias['to']), status)

def dispatch_aliases ( ) : app = current_app aliases_map = app . config . get ( 'ALIASES_MAP' ) if ( aliases_map and ( request . path in aliases_map ) ) : alias = aliases_map [ request . path ] status = alias . get ( 'status' , 200 ) if ( alias [ 'alias_type' ] == 'endpoint' ) : endpoint = alias [ 'to' ] if ( alias . get ( 'action' ) == 'redirect' ) : return redirect ( url_for ( endpoint , ** request . args ) ) else : return app . process_response ( app . make_response ( app . view_functions [ endpoint ] ( ) ) ) elif ( alias [ 'alias_type' ] == 'long_slug' ) : long_slug = alias [ 'to' ] if ( alias . get ( 'action' ) == 'redirect' ) : return redirect ( long_slug ) else : endpoint = route_from ( long_slug ) [ 0 ] return app . process_response ( app . make_response ( app . view_functions [ endpoint ] ( ) ) ) elif ( alias [ 'alias_type' ] == 'url' ) : return redirect ( alias [ 'to' ] ) elif ( alias [ 'alias_type' ] == 'string' ) : return ( render_template_string ( alias [ 'to' ] ) , status ) elif ( alias [ 'alias_type' ] == 'template' ) : return ( render_template ( alias [ 'to' ] ) , status )
when aliases_enabled == true this method handle 3 quokkacms features: 1 .