Exemplo n.º 1
0
 def _wrap(self, blip, command=False):
     if not blip:
         pass
     if self.enforce_bans:
         # Blips have no contributors until something has been typed by a
         # person into the blip.
         bans = Banned.all()
         for contributer in blip.contributors:
             bans.filter('name =', contributer)
         if bans.fetch(1):
             return
     results = self.parse_text(blip.text, self.command_re if command else self.image_re)
     self.replace_in_blip(blip, results, command=command)
Exemplo n.º 2
0
 def add(self, id: int, username: str):
     session.add(Banned(id, username))
     session.commit()
Exemplo n.º 3
0
def ban(date, ip):
    newBan = Banned(date = date, ip = ip)
    db.session.add(newBan)
    db.session.commit()
Exemplo n.º 4
0
 def _ban_user(self, blip, startend, arguments):
     password = arguments[0]
     if password == self.admin_pw:
         for user in arguments[1:]:
             b = Banned(name=user)
             b.put()