def cancel_purchases(self, request, queryset):
        failed = 0
        for obj in queryset:
            try:
                api.cancel_purchase(obj.id)
            except NotCancelableException:
                failed += 1
        count = queryset.count()
        if failed:
            msg = _('Canceled %d purchase(s) (%d failed).')
            msg = msg % (failed - count, failed)
        else:
            msg = _('Canceled %d purchase(s).') % count
        return self.message_user(request, msg)
dataset/ETHPy150Open uppsaladatavetare/foobar-api/src/foobar/admin.py/PurchaseAdmin.cancel_purchases/swapped operands of `-`