Skip to content

Commit

Permalink
WooCommerce import: fixed count not displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelurben committed Nov 28, 2023
1 parent 6b97202 commit 8d2a902
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions kmuhelper/modules/integrations/woocommerce/views.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
import json

from urllib.parse import urlencode
from random import randint
from rich import print
from urllib.parse import urlencode

from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.shortcuts import redirect, render
from django.urls import reverse, reverse_lazy
from django.views.decorators.csrf import csrf_exempt

from django.utils.translation import gettext_lazy, gettext, ngettext
from django.views.decorators.csrf import csrf_exempt
from rich import print

from kmuhelper import settings
from kmuhelper.decorators import (
require_object,
require_all_kmuhelper_perms,
require_any_kmuhelper_perms,
)
from kmuhelper.modules.main.models import Product, Customer, ProductCategory, Order
from kmuhelper.modules.integrations.woocommerce.api import WooCommerce
from kmuhelper.modules.integrations.woocommerce.forms import WooCommerceSettingsForm
from kmuhelper.modules.integrations.woocommerce.utils import (
is_connected,
base64_hmac_sha256,
random_secret,
test_wc_url,
)
from kmuhelper.modules.integrations.woocommerce.forms import WooCommerceSettingsForm
from kmuhelper.modules.main.models import Product, Customer, ProductCategory, Order
from kmuhelper.utils import render_error

_ = gettext_lazy
Expand Down Expand Up @@ -133,7 +131,8 @@ def wc_import_products(request):
"%d new product has been imported from WooCommerce!",
"%d new products have been imported from WooCommerce!",
count,
),
)
% count,
)
return redirect(reverse("admin:kmuhelper_product_changelist"))

Expand All @@ -151,7 +150,8 @@ def wc_import_customers(request):
"%d new customer has been imported from WooCommerce!",
"%d new customers have been imported from WooCommerce!",
count,
),
)
% count,
)
return redirect(reverse("admin:kmuhelper_customer_changelist"))

Expand All @@ -169,7 +169,8 @@ def wc_import_categories(request):
"%d new product category has been imported from WooCommerce!",
"%d new product categories have been imported from WooCommerce!",
count,
),
)
% count,
)
return redirect(reverse("admin:kmuhelper_productcategory_changelist"))

Expand All @@ -187,7 +188,8 @@ def wc_import_orders(request):
"%d new order has been imported from WooCommerce!",
"%d new orders have been imported from WooCommerce!",
count,
),
)
% count,
)
return redirect(reverse("admin:kmuhelper_order_changelist"))

Expand Down

0 comments on commit 8d2a902

Please sign in to comment.