Compare commits

..

2 commits

Author SHA1 Message Date
e4f68895b3 fix ruff 2024-05-01 21:36:12 +00:00
pre-commit-ci[bot]
3f5df89c85 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2)
- [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.4.2)
- [github.com/pre-commit/mirrors-eslint: v9.1.0 → v9.1.1](https://github.com/pre-commit/mirrors-eslint/compare/v9.1.0...v9.1.1)
2024-05-01 21:36:12 +00:00
2 changed files with 5 additions and 4 deletions

View file

@ -31,7 +31,7 @@ repos:
- id: django-upgrade
args: [--target-version, "4.1"]
- repo: https://github.com/psf/black
rev: 24.4.0
rev: 24.4.2
hooks:
- id: black
args: [--target-version, py311]
@ -40,7 +40,7 @@ repos:
hooks:
- id: djhtml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.4.2
hooks:
- id: ruff
args: [--fix]
@ -50,7 +50,7 @@ repos:
- id: prettier
types_or: [javascript, css]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.1.0
rev: v9.1.1
hooks:
- id: eslint
args: [--fix]

View file

@ -164,7 +164,8 @@ class CharacterCapability:
def validate_image(fieldfile_obj, megabytes_limit: float):
filesize = fieldfile_obj.file.size
if filesize > megabytes_limit * 1024 * 1024:
raise ValidationError("La taille maximale est de %sMo" % str(megabytes_limit))
msg = f"La taille maximale est de {megabytes_limit}Mo"
raise ValidationError(msg)
class Character(models.Model):