Skip to content

Commit d81495f

Browse files
authored
fix #245 Django 5.1 error, test in Django 5.1 (#248)
1 parent fa54411 commit d81495f

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

.github/workflows/test.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,26 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
python-version: ['3.8', '3.9', '3.10', '3.11']
9-
django-version: ['3.2', '4.1', '4.2']
8+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
9+
django-version: ['3.2', '4.1', '4.2', '5.0', '5.1.*']
1010
exclude:
1111
- python-version: 3.11
1212
django-version: 3.2
13+
14+
- python-version: 3.12
15+
django-version: 3.2
16+
17+
- python-version: 3.8
18+
django-version: 5.0
19+
20+
- python-version: 3.9
21+
django-version: 5.0
22+
23+
- python-version: 3.8
24+
django-version: 5.1.*
25+
26+
- python-version: 3.9
27+
django-version: 5.1.*
1328
fail-fast: false
1429

1530
steps:
@@ -23,7 +38,7 @@ jobs:
2338
run: |
2439
pip install -r requirements.txt
2540
pip install -r tests/requirements.txt
26-
pip install "Django~=${{ matrix.django-version }}.0" .
41+
pip install "Django==${{ matrix.django-version }}" .
2742
- name: Run Tests
2843
run: |
2944
echo "$(python --version) / Django $(django-admin --version)"

avatar/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class AvatarConf(AppConf):
2424
ALLOWED_FILE_EXTS = None
2525
ALLOWED_MIMETYPES = None
2626
CACHE_TIMEOUT = 60 * 60
27-
STORAGE = settings.DEFAULT_FILE_STORAGE
27+
if hasattr(settings, "DEFAULT_FILE_STORAGE"):
28+
STORAGE = settings.DEFAULT_FILE_STORAGE # deprecated settings
2829
STORAGE_ALIAS = "default"
2930
CLEANUP_DELETED = True
3031
AUTO_GENERATE_SIZES = (DEFAULT_SIZE,)

docs/index.rst

+5
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ appear on the site. Listed below are those settings:
263263
Suggested safe setting: ``("image/png", "image/gif", "image/jpeg")``.
264264
When enabled you'll get the following error on the form upload *File content is invalid. Detected: image/tiff Allowed content types are: image/png, image/gif, image/jpg*.
265265

266+
.. py:data:: AVATAR_STORAGE_ALIAS
267+
268+
Default: 'default'
269+
Alias of the storage backend (from STORAGES settings) to use for storing avatars.
270+
266271

267272
Management Commands
268273
-------------------

0 commit comments

Comments
 (0)