Esempio n. 1
0
 def respond(self, user, business_id, user_to, message):
     """ Used by businesses to respond to user queries
     """
     if not business.user_owns_business(user.user_id(), business_id):
         return {"error": "NOT ALLOWED DOG"}
     interaction = InteractionRecord.get(business_id, user_to)
     if not interaction:
         return {"error": "You cannot contact that user"}
     senderoo = Solicitation(
         interaction = interaction,
         from_contractor=True,
         when = js_time(),
         message = message
     )
     senderoo.put()
     # TODO: tell everyone again
     return model_to_dict(senderoo)