From 5f3cc390007eb8b7b809b8be9d48348b6ef27beb Mon Sep 17 00:00:00 2001 From: rafaelurben Date: Tue, 28 Nov 2023 10:36:12 +0100 Subject: [PATCH] Fixed #243 (TypeError on note creation) --- kmuhelper/modules/main/admin.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/kmuhelper/modules/main/admin.py b/kmuhelper/modules/main/admin.py index d730c61..3238476 100644 --- a/kmuhelper/modules/main/admin.py +++ b/kmuhelper/modules/main/admin.py @@ -1,10 +1,8 @@ -from datetime import datetime - from django.contrib import admin, messages from django.db.models import Count from django.urls import path from django.utils import timezone -from django.utils.translation import gettext_lazy, gettext, ngettext +from django.utils.translation import gettext_lazy, ngettext from kmuhelper import constants from kmuhelper.modules.integrations.woocommerce import WooCommerce @@ -857,22 +855,22 @@ def get_form(self, request, obj=None, change=False, **kwargs): form.base_fields["description"].initial = "" if "from_order" in request.GET: pk = request.GET.get("from_order") - t = _("Bestellung #%d") % pk + t = _("Bestellung #%s") % pk form.base_fields["name"].initial = t form.base_fields["description"].initial += f"\n\n[{t}]" if "from_product" in request.GET: pk = request.GET.get("from_product") - t = _("Produkt #%d") % pk + t = _("Produkt #%s") % pk form.base_fields["name"].initial = t form.base_fields["description"].initial += f"\n\n[{t}]" if "from_customer" in request.GET: pk = request.GET.get("from_customer") - t = _("Kunde #%d") % pk + t = _("Kunde #%s") % pk form.base_fields["name"].initial = t form.base_fields["description"].initial += f"\n\n[{t}]" if "from_supply" in request.GET: pk = request.GET.get("from_supply") - t = _("Lieferung #%d") % pk + t = _("Lieferung #%s") % pk form.base_fields["name"].initial = t form.base_fields["description"].initial += f"\n\n[{t}]" return form