mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Compare commits
3 commits
78b3124cbb
...
094d078e4f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
094d078e4f | ||
|
|
221bf4e21f | ||
|
|
91e5344219 |
3 changed files with 6 additions and 5 deletions
|
|
@ -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]
|
||||||
|
|
|
||||||
|
|
@ -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")
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue