Ejemplo n.º 1
0
 def check_regtoken(self):
     regtoken = self.get_argument("token", "")
     token = RegistrationToken.by_value(regtoken)
     if token is not None and not token.used:
         token.used = True
         self.dbsession.add(token)
         self.dbsession.commit()
     else:
         raise ValidationError("Invalid registration token")
Ejemplo n.º 2
0
 def check_regtoken(self):
     regtoken = self.get_argument('token', '')
     token = RegistrationToken.by_value(regtoken)
     if token is not None and not token.used:
         token.used = True
         self.dbsession.add(token)
         self.dbsession.commit()
     else:
         raise ValidationError("Invalid registration token")
Ejemplo n.º 3
0
 def post(self, *args, **kwargs):
     """ Used to delete regtokens """
     token_value = self.get_argument("token_value", "")
     reg_token = RegistrationToken.by_value(token_value)
     if reg_token is not None:
         self.dbsession.delete(reg_token)
         self.dbsession.commit()
         self.redirect("/admin/regtoken/view")
     else:
         self.render("admin/view/token.html", errors=["Token does not exist"])
Ejemplo n.º 4
0
 def post(self, *args, **kwargs):
     """ Used to delete regtokens """
     token_value = self.get_argument("token_value", "")
     reg_token = RegistrationToken.by_value(token_value)
     if reg_token is not None:
         self.dbsession.delete(reg_token)
         self.dbsession.commit()
         self.redirect("/admin/regtoken/view")
     else:
         self.render("admin/view/token.html", errors=["Token does not exist"])
Ejemplo n.º 5
0
 def post(self, *args, **kwargs):
     ''' Used to delete regtokens '''
     token_value = self.get_argument('token_value', '')
     reg_token = RegistrationToken.by_value(token_value)
     if reg_token is not None:
         self.dbsession.delete(reg_token)
         self.dbsession.commit()
         self.redirect('/admin/regtoken/view')
     else:
         self.render('admin/view/token.html',
                     errors=["Token does not exist"])
Ejemplo n.º 6
0
 def post(self, *args, **kwargs):
     ''' Used to delete regtokens '''
     token_value = self.get_argument('token_value', '')
     reg_token = RegistrationToken.by_value(token_value)
     if reg_token is not None:
         self.dbsession.delete(reg_token)
         self.dbsession.commit()
         self.redirect('/admin/regtoken/view')
     else:
         self.render('admin/view/token.html',
                     errors=["Token does not exist"]
                     )
Ejemplo n.º 7
0
 def create(self):
     """ Adds a registration token to the db and displays the value """
     token = RegistrationToken()
     self.dbsession.add(token)
     self.dbsession.commit()
     self.render("admin/create/token.html", token=token)
Ejemplo n.º 8
0
 def create(self):
     ''' Adds a registration token to the db and displays the value '''
     token = RegistrationToken()
     self.dbsession.add(token)
     self.dbsession.commit()
     self.render('admin/create/token.html', token=token)