Exemplo n.º 1
0
    def changegroup(self):

        try:
            contact = Contact.get(self.getRequiredParameter("contact"))
        except datastore_errors.BadKeyError:
            raise AjaxError("Contact does not exist")

        # oldGroup = contact.group

        try:
            persona = Group.get(self.getRequiredParameter("persona"))
        except datastore_errors.BadKeyError:
            raise AjaxError("Group does not exist")

        # First we check if this psinque is not already asigned to that group
        contact.group = group
        contact.put()

        # oldGroupSize = Contact.all(keys_only = True). \
        # filter("group =", oldGroup). \
        # count(1)
        # if oldGroupSize == 0:
        # olfGroup.delete()

        self.sendJsonOK()