replacement of configuration variable acquisition

This commit is contained in:
kitoy 2026-01-10 01:04:38 +01:00
parent c669987ae7
commit 2b04397f7d

View File

@ -17,19 +17,19 @@ app = Flask( 'pywallter' )
app.config.from_pyfile('config.py')
#### Variables ####################################################################################
DOSSIER_PERSO = app.config['DOSSIER_APP']
#### Variables ###################################################################################
DOSSIER_PERSO = app.config.get('DOSSIER_APP')
extensionimg = app.config['EXT_IMG']
extensionimg = app.config.get('EXT_IMG')
DATABASE = app.config['DATABASE']
DATAS_USER = app.config['DOSSIER_APP']
MAIL_SERVER = app.config['MAIL_SERVER']
XMPP_SERVER = app.config['XMPP_SERVER']
SETUID = app.config['SETUID']
BASE_URL = app.config['BASE_URL']
MAIL_WEBSERVICE = app.config['MAIL_WEBSERVICE']
XMPP_WEBSERVICE = app.config['XMPP_WEBSERVICE']
DATABASE = app.config.get('DATABASE')
DATAS_USER = app.config.get('DOSSIER_APP')
MAIL_SERVER = app.config.get('MAIL_SERVER')
XMPP_SERVER = app.config.get('XMPP_SERVER')
SETUID = app.config.get('SETUID')
BASE_URL = app.config.get('BASE_URL')
MAIL_WEBSERVICE = app.config.get('MAIL_WEBSERVICE')
XMPP_WEBSERVICE = app.config.get('XMPP_WEBSERVICE')
##################################################################################################
@ -49,12 +49,13 @@ def mymessaging():
myemail = tmp[0]
return render_template('mymessaging.html',
section="mymessaging",
hostname=hostname,
myemail=myemail,
imap_address=app.config['IMAP_ADDRESS'],
smtp_address=app.config['SMTP_ADDRESS'],
imap_address=app.config.get('IMAP_ADDRESS'),
smtp_address=app.config.get('SMTP_ADDRESS'),
mail_server=MAIL_SERVER,
mail_webservice=MAIL_WEBSERVICE,
xmpp_server=XMPP_SERVER,
@ -65,8 +66,6 @@ def mymessaging():
@mymailbox.route('/mymailbox/alias', methods=['GET', 'POST'] )
@login_required
def myalias():
hostname = set_mail_domain()
user='%s' % escape(session['username'])
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée