Beispiel #1
0
    def post(self):
        form = radius_form.radius_update_form([])
        if not form.validates(source=self.get_params()):
            return self.render("base_form.html", form=form)

        radius = self.db.query(models.TTRadius).get(form.d.id)
        radius.ip_addr = form.d.ip_addr
        radius.name = form.d.name
        radius.secret = form.d.secret
        radius.acct_port = form.d.acct_port
        radius.auth_port = form.d.auth_port
        radius.serv_type = form.d.serv_type
        self.db.commit()
        self.redirect("/radius", permanent=False)
Beispiel #2
0
 def get(self):
     radius_id = self.get_argument("radius_id")
     radius = self.db.query(models.TTRadius).get(radius_id)
     form = radius_form.radius_update_form()
     form.fill(radius)
     return self.render("base_form.html", form=form)