예제 #1
0
def user_preferences():
    if request.method == 'GET':
        if current_user.jira_password is None:
            return render_template('preferences.html', user=current_user, password = "")
        else:
            return render_template('preferences.html', user=current_user, password = decryption(current_user.jira_password))
    current_user.name = request.form['name']
    current_user.cc_login = request.form['cc_login']
    current_user.jira_login = request.form['jira_login']
    current_user.jira_password = encryption(request.form['jira_password'])
    db.session.commit()
    flash('User successfully updated his preferences')
    logger.info('User {email} successfully updated preferences.'.format(email=current_user.email))
    return redirect(url_for('user_preferences'))
예제 #2
0
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy

archiver_login = "******"
archiver_password = "******"

app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///testing.db"
db = SQLAlchemy(app)

db.create_all()


from app.jira import integrate_all_old
from app.crypto import encryption

integrate_all_old(archiver_login, encryption(archiver_password))