def delete(self, contactIdStr): contact = Contact.getByIdString(contactIdStr) if contact: if contact.isDefaultSender(): raise errors.ValidationError("Cannot delete default sender.") logging.info("Deleting contact " + contact.name) contact.delete()
def post(self): appId = app_identity.get_application_id() idsToInvite = json.loads(self.request.body) invited = [] if owner.xmppEnabled(): for contactId in idsToInvite: contact = Contact.getByIdString(contactId) xmppVoiceMail.sendXmppInvite(contact.name) invited.append(contact.name) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json.dumps(invited))