Commit 4978b03d authored by Nicolas Joyard's avatar Nicolas Joyard


parent 63f3ae1f
......@@ -58,5 +58,5 @@ class EtapesImporter(BaseImporter):
db.session.commit()'Import étapes terminé: %s créées, %s mises à jour, ' \'Import étapes terminé: %s créées, %s mises à jour, '
'%s supprimées' % (created, updated, deleted))
......@@ -3,9 +3,9 @@
import os
from flask import make_response, render_template
from sqlalchemy.orm import contains_eager, joinedload
from sqlalchemy.orm import joinedload
from .util import redirect_back, require_admin
from .util import not_found, redirect_back, require_admin
from ..models import db, Action, Etape, Parlementaire
from ..models.constants import ETAPE_A_ENVOYER, ETAPE_A_CONFIRMER, EXTENSIONS
......@@ -25,7 +25,6 @@ def setup_routes(app):
titre='Actions récentes',
@app.route('/admin/en-attente', endpoint='admin_en_attente')
def admin_en_attente():
......@@ -44,8 +43,6 @@ def setup_routes(app):
titre='Actions en attente',
@app.route('/admin/delete/<id>', endpoint='admin_delete')
def admin_delete(id):
......@@ -16,7 +16,6 @@ def setup_routes(app):
h.update(bytes(request.form['email'], encoding='utf-8'))
digest = h.hexdigest()
if hmac.compare_digest(digest, app.config['ADMIN_PASSWORD']):
session['user'] = {
'nick': '!rc',
......@@ -62,6 +62,7 @@ def require_user(f):
return decorator
def require_admin(f):
def decorator(*args, **kwargs):
if not session.get('user') or not session.get('user')['admin']:
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment