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

Patch for Django 4.1 support. #44

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

sarahboyce
Copy link
Contributor

@pcraciunoiu I'm so so sorry, it looks like there was another change required that I missed

AttributeError: 'UserAgentMiddleware' object has no attribute '_is_coroutine'

SelectedBackend was missing calling the init of it's parent (and so was missing this _is_coroutine added in the django async work)
But doing this meant you cannot just do SelectedBackend() as get_response is required, so I have created a SelectedBackendMixin which can be called in the helper function

Would you be able to review and maybe issue a patch release 🙏

Fixes: AttributeError: 'UserAgentMiddleware' object has no attribute '_is_coroutine'
@@ -1,10 +1,10 @@
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.backends import SelectedBackendMixin
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did this need to be switched to use the mixin? It was using the backend before. Does the new SelectedBackend require get_response because of the middleware mixin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes exactly 👍
The django MiddlewareMixin means SelectedBackend requires get_response, so we can't do SelectedBackend() without passing something in.

@pcraciunoiu pcraciunoiu merged commit f13a3a4 into skoczen:master Sep 27, 2022
@pcraciunoiu
Copy link
Collaborator

Thanks @sarahboyce released as 0.4.1. Please test thoroughly.

@pcraciunoiu
Copy link
Collaborator

@skoczen what do you think about converting this to an org? I help maintain this https://github.com/django-ses/django-ses and it'd be easier to set up Actions for deploys if I had access

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.

2 participants