def post(self): key = self.request.get("key") message = self.request.get("message") url = self.request.get("url") code = self.request.get("code") securitycode = SecurityCode() if securitycode.check(code): if key is not None and key != "" and message is not None and message != "": try: user = User.get(key) notification = Notification() notification.user = str(user.key()) notification.message = message notification.url = url notification.status = 0 notification.put() self.redirect("/") except KeyError: self.redirect("/?exception=WrongParameter") else: self.redirect("/?exception=WrongParameter") else: self.redirect("/?exception=AccessDenied")