def post(self):
        self.response.headers.add_header("Access-Control-Allow-Origin", "*")
        user = auth.getCurrentUser()
        response = {}
        if user:
            try:
                user_data = models.getUser(user)
            except models.UserDoesNotExistError:
                user_data = models.UserData(user=user).save()
            name = self.request.get('name')
            if not name:
                name = "Chrome"
            try:
                device = models.getDevice((user.email(), name) % "%s/%s")
            except models.DeviceDoesNotExistError:
                device = models.DeviceData(name=name, user=user_data).save()
            receiver = None
            if self.request.get("receiver"):
                try:
                    receiver = models.getDevice("%s/%s" % (user.email(),
                      self.request.get("receiver")))
                except models.DeviceDoesNotExistError:
                    receiver = models.DeviceData(
                        name=self.request.get("receiver"),
                        user=user_data).save()
            if receiver == None:
                receiver = device
            link = models.LinkData(url=self.request.get('link'),
                sender=device, receiver=receiver).save()
            if models.getQuota().amount >= models.getStats(
                    'channels').count or user_data.immune():
                channel = channels.Channel(receiver.address, False)
                channel.sendLink(link)
                response['code'] = 200
                response['link'] = link.url
            else:
                response['code'] = 503
                response['link'] = link.url
        else:
            response['code'] = 401
            response['link'] = self.request.get('link')
        self.response.out.write(simplejson.dumps(response))
dataset/ETHPy150Open 2cloud/AppEngine/devlinks.py/AddLinkPage.post/swapped operands of `%`