Esempio n. 1
0
 def get(self, message_key_url):
     message = Message.get_message(message_key_url)
     if message is not None:
         if message.to_user.user_id() == users.get_current_user().user_id():
             self.render("message.html", {'message': message})
         else:
             self.error(403)
     else:
         self.error(404)
Esempio n. 2
0
 def post(self, message_key_url):
     action = self.request.get('action')
     if action == 'delete':
         message = Message.get_message(message_key_url)
         if message is not None:
             if message.to_user.user_id() == users.get_current_user().user_id():
                 Message.delete(message_key_url)
                 self.redirect("/inbox")
             else:
                 self.error(403)
         else:
             self.error(404)