Fix implementation of Flask wrapper decorators
This commit is contained in:
parent
ed6b1de5a6
commit
3fc98c8a36
@ -25,6 +25,8 @@ from eos.psr.workflow import *
|
|||||||
|
|
||||||
import eos.core.hashing
|
import eos.core.hashing
|
||||||
|
|
||||||
|
import functools
|
||||||
|
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
|
|
||||||
@app.cli.command('test')
|
@app.cli.command('test')
|
||||||
@ -81,6 +83,7 @@ def index():
|
|||||||
return flask.render_template('index.html')
|
return flask.render_template('index.html')
|
||||||
|
|
||||||
def using_election(func):
|
def using_election(func):
|
||||||
|
@functools.wraps(func)
|
||||||
def wrapped(election_id):
|
def wrapped(election_id):
|
||||||
election = Election.get_by_id(election_id)
|
election = Election.get_by_id(election_id)
|
||||||
return func(election)
|
return func(election)
|
||||||
|
Loading…
Reference in New Issue
Block a user