This commit is contained in:
pre-commit-ci[bot] 2026-03-16 17:38:54 +00:00 committed by GitHub
commit 094d078e4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View file

@ -6,13 +6,13 @@ repos:
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/pycqa/isort - repo: https://github.com/pycqa/isort
rev: "7.0.0" rev: "8.0.1"
hooks: hooks:
- id: isort - id: isort
args: ["--profile", "black"] args: ["--profile", "black"]
- repo: https://github.com/psf/black - repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0 rev: 26.3.1
hooks: hooks:
- id: black - id: black
args: [--target-version=py310] args: [--target-version=py310]

View file

@ -42,11 +42,11 @@ def avatar_path_handler(
# Filename already stored in database # Filename already stored in database
filename = instance.avatar.name filename = instance.avatar.name
if ext: if ext:
(root, oldext) = os.path.splitext(filename) root, oldext = os.path.splitext(filename)
filename = root + "." + ext.lower() filename = root + "." + ext.lower()
else: else:
# File doesn't exist yet # File doesn't exist yet
(root, oldext) = os.path.splitext(filename) root, oldext = os.path.splitext(filename)
if settings.AVATAR_HASH_FILENAMES: if settings.AVATAR_HASH_FILENAMES:
if settings.AVATAR_RANDOMIZE_HASHES: if settings.AVATAR_RANDOMIZE_HASHES:
root = binascii.hexlify(os.urandom(16)).decode("ascii") root = binascii.hexlify(os.urandom(16)).decode("ascii")

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
"""Django's command-line utility for administrative tasks.""" """Django's command-line utility for administrative tasks."""
import os import os
import sys import sys