Pre-commit autoupdate and run on --all-files.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Víðir Valberg Guðmundsson 2023-01-03 21:39:40 +01:00
parent 704b196128
commit e38bd56549
3 changed files with 11 additions and 15 deletions

View file

@ -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

View file

@ -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")

View file

@ -89,7 +89,6 @@ TIME_ZONE = "Europe/Copenhagen"
USE_I18N = True
USE_L10N = True
USE_TZ = True