Commit 72073828 authored by Romain Loth's avatar Romain Loth

remove direct calls to templating system (render_template does them for us)

parent 9bd0ef7e
...@@ -19,8 +19,6 @@ __status__ = "Dev" ...@@ -19,8 +19,6 @@ __status__ = "Dev"
from flask import Flask, render_template, request from flask import Flask, render_template, request
from ctypes import c_int32 from ctypes import c_int32
# from time import sleep
from jinja2 import Template, Environment, FileSystemLoader
from MySQLdb import connect, ProgrammingError from MySQLdb import connect, ProgrammingError
from re import sub from re import sub
from os import environ from os import environ
...@@ -37,10 +35,6 @@ app = Flask(__name__) ...@@ -37,10 +35,6 @@ app = Flask(__name__)
app.config['DEBUG'] = MY_DEBUG_FLAG app.config['DEBUG'] = MY_DEBUG_FLAG
# templating setup
templating_env = Environment(loader = FileSystemLoader('templates'),
autoescape = False)
########### PARAMS ########### ########### PARAMS ###########
# all columns as they are declared in form & DB as tuple: # all columns as they are declared in form & DB as tuple:
...@@ -155,13 +149,6 @@ def re_hash(userinput, salt="verylonverylongverylonverylongverylonverylong"): ...@@ -155,13 +149,6 @@ def re_hash(userinput, salt="verylonverylongverylonverylongverylonverylong"):
return hashk return hashk
def get_template(filename):
"""
Retrieve a jinja2 template from templates
£TODO: check if necessary in server context ?
"""
return templating_env.get_template(filename)
def sanitize(value): def sanitize(value):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment