def delete(self): result = User.delete_one(self.root.db, username=self.name) if result and result['ok'] != 1: raise NotFound(self)