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

Fix storages deprecation warnings #372

Merged

Conversation

browniebroke
Copy link
Contributor

@browniebroke browniebroke commented Jul 11, 2023

Builds on top of #363 to resolve the deprecation warning coming out of the new unified STORAGES setting.

Fix #366
Closes #365

from django.conf import settings
from django.core.files.base import ContentFile
from django.core.files.storage import get_storage_class

if django.VERSION >= (4, 2):
Copy link
Contributor Author

@browniebroke browniebroke Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the versioned block approach over the try/catch ImportError as this is automatically fixable by django-upgrade when we'll need to remove it.

@browniebroke browniebroke marked this pull request as ready for review August 3, 2023 07:52
@KOliver94
Copy link
Contributor

Hey @frankwiles and @jefftriplett,

Can you please check this and the other compatibility improvement PR (#363)?

Thank you!

@jefftriplett
Copy link
Member

@KOliver94 I'll ping Frank and see if he has time tomorrow to check it. He's a little closer to the project than me, and he can cut release.

Copy link
Member

@jefftriplett jefftriplett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@frankwiles frankwiles merged commit 59a990a into revsys:upgrade-django-to-4-2 Oct 19, 2023
frankwiles added a commit that referenced this pull request Oct 19, 2023
* ⚙️ Adds Django 4.2 support and fixes trove classifiers

* :shirts: Runs black on code to make CI happy

* :shirts: Runs isort on code to make CI happy

* 💚 Updates test to match exception copy

* 📝 mirrors old README.rst to make docs work

Not a great solution, but a workaround.

* ⚙️ Adds pip cache support

* 🔥 Removes 4.0 from grid because it's no longer supported

* ⚙️ Updates cache-key

This isn't really used, but I think having caching is a win

* ⚙️ Adds missing file

* 🔥 Removes cache line

* Fix storages deprecation warnings (#372)

* ⚙️ Adds Django 4.2 support and fixes trove classifiers

* :shirts: Runs black on code to make CI happy

* :shirts: Runs isort on code to make CI happy

* 💚 Updates test to match exception copy

* 📝 mirrors old README.rst to make docs work

Not a great solution, but a workaround.

* ⚙️ Adds pip cache support

* 🔥 Removes 4.0 from grid because it's no longer supported

* ⚙️ Updates cache-key

This isn't really used, but I think having caching is a win

* ⚙️ Adds missing file

* 🔥 Removes cache line

* Fix storages deprecation warnings

---------

Co-authored-by: Jeff Triplett <[email protected]>

* Fix isort ordering

---------

Co-authored-by: Bruno Alla <[email protected]>
Co-authored-by: Frank Wiles <[email protected]>
@browniebroke browniebroke deleted the fix/storages-deprecations branch October 19, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants