Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr/django51 #191

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion categories/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from .settings import (
RELATION_MODELS,
RELATIONS,
THUMBNAIL_STORAGE,
THUMBNAIL_STORAGE_ALIAS,
THUMBNAIL_UPLOAD_PATH,
)
Expand All @@ -27,6 +26,8 @@
except ImportError:
from django.core.files.storage import get_storage_class

from .settings import THUMBNAIL_STORAGE

Check warning on line 29 in categories/models.py

View check run for this annotation

Codecov / codecov/patch

categories/models.py#L29

Added line #L29 was not covered by tests

STORAGE = get_storage_class(THUMBNAIL_STORAGE)()


Expand Down
4 changes: 3 additions & 1 deletion categories/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
"M2M_REGISTRY": {},
"FK_REGISTRY": {},
"THUMBNAIL_UPLOAD_PATH": "uploads/categories/thumbnails",
"THUMBNAIL_STORAGE": settings.DEFAULT_FILE_STORAGE,
"THUMBNAIL_STORAGE_ALIAS": "default",
"JAVASCRIPT_URL": getattr(settings, "STATIC_URL", settings.MEDIA_URL) + "js/",
"SLUG_TRANSLITERATOR": "",
"REGISTER_ADMIN": True,
"RELATION_MODELS": [],
}

if hasattr(settings, "DEFAULT_FILE_STORAGE"):
DEFAULT_SETTINGS["THUMBNAIL_STORAGE"] = settings.DEFAULT_FILE_STORAGE

Check warning on line 22 in categories/settings.py

View check run for this annotation

Codecov / codecov/patch

categories/settings.py#L22

Added line #L22 was not covered by tests

DEFAULT_SETTINGS.update(getattr(settings, "CATEGORIES_SETTINGS", {}))

if DEFAULT_SETTINGS["SLUG_TRANSLITERATOR"]:
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ envlist =
py{37,38,39,310}-django{32}
py{38,39,310}-django{40}
py{38,39,310,311}-django{41}
py{310,311,312}-django{42,50}
py{310,311,312}-django{42,50,51}
coverage-report

[gh-actions]
Expand All @@ -32,6 +32,7 @@ deps=
django41: Django>=4.1,<4.2
django42: Django>=4.2,<5.0
django50: Django>=5.0,<5.1
django51: git+https://github.com/django/django@main # TODO: update when Django 5.1 is released
coverage[toml]
pillow
ipdb
Expand Down
Loading