From e38bd565499044b8c455c45867f542e7830a263b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Tue, 3 Jan 2023 21:39:40 +0100 Subject: [PATCH] Pre-commit autoupdate and run on --all-files. --- .pre-commit-config.yaml | 16 ++++++++-------- src/accounting/admin.py | 9 +++------ src/project/settings.py | 1 - 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9615dd..d41366d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,11 +2,11 @@ default_language_version: python: python3 repos: - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 22.12.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: check-ast - id: check-merge-conflict @@ -19,7 +19,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 additional_dependencies: @@ -28,7 +28,7 @@ repos: - flake8-tidy-imports args: [--max-line-length=88, --extend-exclude=src/project/settings/deployments/*] - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.2 + rev: v3.9.0 hooks: - id: reorder-python-imports args: @@ -36,15 +36,15 @@ repos: - --application-directories=.:src exclude: migrations/ - repo: https://github.com/asottile/pyupgrade - rev: v2.37.3 + rev: v3.3.1 hooks: - id: pyupgrade args: - - --py39-plus + - --py310-plus exclude: migrations/ - repo: https://github.com/adamchainz/django-upgrade - rev: 1.7.0 + rev: 1.12.0 hooks: - id: django-upgrade args: - - --target-version=3.2 + - --target-version=4.1 diff --git a/src/accounting/admin.py b/src/accounting/admin.py index 61e4ada..6115dc8 100644 --- a/src/accounting/admin.py +++ b/src/accounting/admin.py @@ -9,23 +9,20 @@ class OrderAdmin(admin.ModelAdmin): list_display = ("who", "description", "created", "is_paid") + @admin.display(description=_("Customer")) def who(self, instance): return instance.user.get_full_name() - who.short_description = _("Customer") - @admin.register(models.Payment) class PaymentAdmin(admin.ModelAdmin): list_display = ("who", "description", "order_id", "created") + @admin.display(description=_("Customer")) def who(self, instance): return instance.order.user.get_full_name() - who.short_description = _("Customer") - + @admin.display(description=_("Order ID")) def order_id(self, instance): return instance.order.id - - order_id.short_description = _("Order ID") diff --git a/src/project/settings.py b/src/project/settings.py index a9f9763..3a203f3 100644 --- a/src/project/settings.py +++ b/src/project/settings.py @@ -89,7 +89,6 @@ TIME_ZONE = "Europe/Copenhagen" USE_I18N = True -USE_L10N = True USE_TZ = True