Skip to content

#47 - Setting up wagtail-bynder without BYNDER_VIDEO_MODEL throws a TypeError - #48

Open
SharmaineLim wants to merge 1 commit into
torchbox:mainfrom
SharmaineLim:fix/editor-js-returns-none
Open

#47 - Setting up wagtail-bynder without BYNDER_VIDEO_MODEL throws a TypeError#48
SharmaineLim wants to merge 1 commit into
torchbox:mainfrom
SharmaineLim:fix/editor-js-returns-none

Conversation

@SharmaineLim

@SharmaineLim SharmaineLim commented Jul 21, 2026

Copy link
Copy Markdown

Closes #47

Context

Currently, editor_js returns None if no BYNDER_VIDEO_MODEL is configured. This None gets fed into a "".join() which checks that the objects passed in are strings, and triggers a TypeError with expected str instance, NoneType found whenever Wagtail admin editor page is loaded.

Screenshot: All page editors on Wagtail admin look like this when no video model is configured image

Description of fix

In this PR, we edit editor_js to return an empty string instead of None so that we pass the correct object type to "".join().

Currently, editor_js returns None if no BYNDER_VIDEO_MODEL is configured. This None gets fed into a ''.join() which checks that the objects passed in are strings. This triggers a 'TypeError: expected str instance, NoneType found' whenever Wagtail admin editor page is loaded.

Relevant links:
https://github.com/torchbox/wagtail-bynder/blob/v0.8.1/src/wagtail_bynder/wagtail_hooks.py\#L51
https://github.com/wagtail/wagtail/blob/v7.4/wagtail/admin/templatetags/wagtailadmin_tags.py\#L313
https://docs.python.org/3/library/stdtypes.html\#str.join
@SharmaineLim

SharmaineLim commented Jul 21, 2026

Copy link
Copy Markdown
Author

Since I didn't touch any environment files, I assume the failing test is not introduced by my change.

Screenshot: Failed test image

I see a similar failure in a different PR.

@zerolab

zerolab commented Jul 21, 2026

Copy link
Copy Markdown
Member

Hey @SharmaineLim, if you rebase on latest main, all should be sorted.
Also, could you add a test that we get a HttpStatus.OK when GET-ing a page edit form?

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.

Setting up wagtail-bynder without BYNDER_VIDEO_MODEL throws a TypeError

2 participants