示例#1
0
 def index(self):
     current_app.config['confd']['token'] = current_app.config[
         'service_token']
     with confd_client(current_app.config['confd']) as confd:
         fk = gen_template_fk(
             confd,
             confd.users.relations(get_id(
                 confd, current_user.get_uuid())).list_funckeys())
     return render_template('fk.html',
                            fk=fk,
                            rabbitmq=current_app.config['rabbitmq'])
示例#2
0
 def post(self):
     form=FormCTIPassword()
     if form.validate_on_submit():
         user = dict(id=current_user.get_uuid(),password=form.data['password'])
         current_app.config['confd']['token'] = current_app.config['service_token']
         with confd_client(current_app.config['confd']) as confd:
             try:
                 confd.users.update(user)
                 return redirect(url_for('q_ctipassword.CTIPassword:get'))
             except:
                 print "Error to update user password"
     return render_template('ctipassword.html',form=form)
示例#3
0
 def index(self):
     current_app.config['confd']['token'] = current_app.config['service_token']
     with confd_client(current_app.config['confd']) as confd:
         fk = gen_template_fk(confd, confd.users.relations(get_id(confd, current_user.get_uuid())).list_funckeys())
     return render_template('fk.html', fk=fk, rabbitmq=current_app.config['rabbitmq'])