def fix(msg=''): if request.method == 'GET': return render_template("fix.html",msg='') else: uname = request.form['username'] password = request.form['password'] if (uname in utils.users()): if utils.authenticate(uname, password): new_password = request.form['newpass'] confirm = request.form['confirm'] if new_password != confirm: return render_template("fix.html", msg="The passwords do not match. Try again") elif len(new_password) < 6: return render_template("fix.html", msg="The password must be at least 6 characters") else: utils.correct_password(password, new_password) if 'user' in session: session['user'] = '' return redirect(url_for("login")) else: return render_template("fix.html", msg="That's the wrong username!")
from sharer import Sharer from utils import users if __name__ == '__main__': for email, password in users(): Sharer(email, password).create_share()
def about(): users = utils.users() #print users return(render_template("about.html",users=users))
def users(): return dict(data=utils.users())