def post(self):
        if not self.can('send_broadcast'):
            self.send_response(FORBIDDEN, dict(error="No permission to send broadcast"))
            return
        # if request body is json entity
        data = self.json_decode(self.request.body)
        # the cannel to be boradcasted
        channel = data.get('channel', 'default')
        # device type
        device = data.get('device', None)
        # iOS and Android shared params
        alert = ''.join(data.get('alert', '').splitlines())
        # iOS
        sound = data.get('sound', None)
        badge = data.get('badge', None)
        self.add_to_log('%s broadcast' % self.appname, alert, "important")
        self.application.send_broadcast(self.appname, self.db,
                channel=channel,
                alert=alert,
                sound=sound,
                badge=badge,
                device=device,
                gcm=data.get('gcm', {}),
                mpns=data.get('mpns', {}),
                wns=data.get('wns', {}),
                sms=data.get('sms', {}),
                apns=data.get('apns', {}),
                )
        delta_t = self._time_start - time.time()
        logging.info("Broadcast took time: %sms" % (delta_t * 1000))
        self.send_response(ACCEPTED)
dataset/ETHPy150Open airnotifier/airnotifier/api/broadcast.py/BroadcastHandler.post/swapped operands of `-`