question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wagtail and get_schemajs_view in Django 4

See original GitHub issue

Issue Summary

We currently are trying to upgrade to Django 4 and Wagtail 3 but right now we are stuck with get_schemajs_view from Django Rest Framework failing. The problem happens in wagtail/api/v2/views.py Line 532 in PagesAPIViewset

  File "/Users/saschahofmann/Projects/gyana/.venv/lib/python3.9/site-packages/wagtail/api/v2/views.py", line 533, in get_queryset
    request.GET.get("type", "wagtailcore.Page")
AttributeError: 'NoneType' object has no attribute 'GET'

It seems like the request can be None when the schema is loaded/created. In fact, we catch this for our own ViewSets in some places.

I started to add some handling for when request is None but before I go to deep, I wanted to ask whether you guys know what’s up. I thought maybe it’s related to #3549 but this was working before the upgrade so I am not convinced.

Technical details

  • Python version: 3.9.4
  • Django version: 4.0.4
  • Wagtail version: 3.0

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
saschahofmanncommented, May 25, 2022

Ok I am able to get rid of the error by monkey patching PagesAPIViewset like this PagesAPIViewSet.schema = None

That way it’s ignored during schema creation. not ideal though

0reactions
saschahofmanncommented, May 25, 2022

Is there a way for me to somehow ignore these new views?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrating Wagtail into a Django project
Wagtail provides the wagtail start command and project template to get you started with a new Wagtail project as quickly as possible, but...
Read more >
Wagtail 4.0 release notes
This release adds support for Django 4.1. When upgrading, please note that the django-taggit library also needs to be updated to 3.0.0 or ......
Read more >
How to add Wagtail into an existing Django project
Configuring Django to load Wagtail involves adding modules and variables to settings.py and URL configuration to urls.py . For a more complete view...
Read more >
Wagtail CMS - Django Content Management System
Meet Wagtail, an open-source Django content management system powered by Python. It's free, beautiful, versatile and fast. Find out how to get started....
Read more >
Configuring Django for Wagtail
Configuring Django to load Wagtail involves adding modules and variables to settings.py and URL configuration to urls.py . For a more complete view...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found