forked from ScoDoc/ScoDoc
temp
This commit is contained in:
parent
8e01bad6cb
commit
cba292c1e8
|
@ -39,6 +39,7 @@ from wtforms import SelectField, SubmitField, FormField, validators, FieldList
|
|||
from wtforms.fields.simple import BooleanField, StringField, HiddenField
|
||||
|
||||
import app
|
||||
from app import AccessDenied
|
||||
from app.models import Departement
|
||||
from app.models import ScoDocSiteConfig
|
||||
from app.scodoc import sco_logos, html_sco_header
|
||||
|
@ -50,6 +51,8 @@ from app.scodoc.sco_config_actions import (
|
|||
BonusSportUpdate,
|
||||
)
|
||||
|
||||
from flask_login import current_user
|
||||
|
||||
JAVASCRIPTS = html_sco_header.BOOTSTRAP_MULTISELECT_JS + []
|
||||
|
||||
CSSSTYLES = html_sco_header.BOOTSTRAP_MULTISELECT_CSS
|
||||
|
@ -330,6 +333,10 @@ def configuration():
|
|||
modele = sco_logos.list_logos()
|
||||
form.build(modele)
|
||||
if form.validate_on_submit():
|
||||
auth_name = str(current_user)
|
||||
if not current_user.is_administrator():
|
||||
raise AccessDenied("invalid user (%s) must be SuperAdmin" % auth_name)
|
||||
|
||||
actions = form.get_actions(form.data)
|
||||
for action in actions:
|
||||
action.execute()
|
||||
|
|
Loading…
Reference in New Issue
Block a user