Esempio n. 1
0
def delete():
    if session.get('role') != 'admin':
        return redirect('/')
    id = request.args.get('id')
    db.deluser(id)
    return render_template('userlist.html',
                           users=db.userlist(),
                           username=session.get('name'))
Esempio n. 2
0
def deluser(email, token):
    if (token != app_token):
        abort(404)
    if (db.deluser(email)):
        return "Deleted User"
    else:
        return "User doesn't Exist"
Esempio n. 3
0
def unsubscribe(email):
    if (db.deluser(email)):
        return render_template('unsubscribed.html')
    else:
        text = 'You are not subscribed to this newsletter.'
        return render_template('error.html', text=text, again=False)
Esempio n. 4
0
def delete():
    if session.get('role') != 'admin':
        return redirect('/')
    name = request.args.get('name')
    db.deluser(name)
    return redirect('/user')
Esempio n. 5
0
def delete():
    id = request.args.get('id')
    db.deluser(id)
    return render_template('userlist.html',users = db.userlist())
Esempio n. 6
0
def delete():
    id = request.args.get('id')
    db.deluser(id)
    return render_template('userlist.html', users=db.userlist())
Esempio n. 7
0
def delete():
    if session.get('role') != 'admin':
        return redirect('/login')
    id = request.form.get('id')
    db.deluser(id)
    return json.dumps({'code': 0, 'result': 'delete success!'})
Esempio n. 8
0
def delete():
    if session.get('role') != 'admin':
	return redirect('/')
    id = request.args.get('id')
    db.deluser(id)
    return render_template('userlist.html',users = db.userlist(),username = session.get('name'))