mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-04-20 15:01:03 +00:00
Merge branch 'main' into urls
This commit is contained in:
commit
ef6decb33b
9 changed files with 22 additions and 18 deletions
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
|
|
@ -6,10 +6,13 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.8', '3.9', '3.10', '3.11']
|
||||
django-version: ['3.2', '4.0', '4.1']
|
||||
django-version: ['3.2', '4.1', '4.2']
|
||||
include:
|
||||
- python-version: 3.7
|
||||
django-version: 3.2
|
||||
exclude:
|
||||
- python-version: 3.11
|
||||
django-version: 3.2
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
|
|
@ -12,13 +12,13 @@ repos:
|
|||
args: ["--profile", "black"]
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.1.0
|
||||
rev: 23.9.1
|
||||
hooks:
|
||||
- id: black
|
||||
args: [--target-version=py310]
|
||||
|
||||
- repo: https://github.com/pycqa/flake8
|
||||
rev: '6.0.0'
|
||||
rev: '6.1.0'
|
||||
hooks:
|
||||
- id: flake8
|
||||
additional_dependencies:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
Changelog
|
||||
=========
|
||||
* Unreleased
|
||||
* Use ``Image.Resampling.LANCZOS`` instead of ``Image.LANCZOS`` that was removed in Pillow 10.0.0
|
||||
|
||||
* 7.1.1 (February 23, 2023)
|
||||
* Switch to setuptools for building
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,12 @@ class AvatarAdmin(admin.ModelAdmin):
|
|||
list_per_page = 50
|
||||
|
||||
def get_avatar(self, avatar_in):
|
||||
context = dict(
|
||||
{
|
||||
"user": avatar_in.user,
|
||||
"url": avatar_in.avatar.url,
|
||||
"alt": str(avatar_in.user),
|
||||
"size": 80,
|
||||
}
|
||||
)
|
||||
context = {
|
||||
"user": avatar_in.user,
|
||||
"url": avatar_in.avatar.url,
|
||||
"alt": str(avatar_in.user),
|
||||
"size": 80,
|
||||
}
|
||||
return render_to_string("avatar/avatar_tag.html", context)
|
||||
|
||||
get_avatar.short_description = _("Avatar")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from PIL import Image
|
|||
|
||||
class AvatarConf(AppConf):
|
||||
DEFAULT_SIZE = 80
|
||||
RESIZE_METHOD = Image.LANCZOS
|
||||
RESIZE_METHOD = Image.Resampling.LANCZOS
|
||||
STORAGE_DIR = "avatars"
|
||||
PATH_HANDLER = "avatar.models.avatar_path_handler"
|
||||
GRAVATAR_BASE_URL = "https://www.gravatar.com/avatar/"
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ appear on the site. Listed below are those settings:
|
|||
.. py:data:: AVATAR_RESIZE_METHOD
|
||||
|
||||
The method to use when resizing images, based on the options available in
|
||||
Pillow. Defaults to ``Image.LANCZOS``.
|
||||
Pillow. Defaults to ``Image.Resampling.LANCZOS``.
|
||||
|
||||
.. py:data:: AVATAR_STORAGE_DIR
|
||||
|
||||
|
|
|
|||
|
|
@ -17,16 +17,16 @@ classifiers=[
|
|||
"Intended Audience :: Developers",
|
||||
"Framework :: Django",
|
||||
"Framework :: Django :: 3.2",
|
||||
"Framework :: Django :: 4.0",
|
||||
"Framework :: Django :: 4.1",
|
||||
"Framework :: Django :: 4.2",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
]
|
||||
dynamic = ["version", "dependencies"]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
Pillow>=8.4.0
|
||||
Pillow>=9.3.0
|
||||
django-appconf>=1.0.5
|
||||
dnspython>=2.3.0
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
coverage==7.1.0
|
||||
coverage~=7.1.0
|
||||
django
|
||||
python-magic
|
||||
|
|
|
|||
Loading…
Reference in a new issue