torchbox / wagtailmedia

A Wagtail module for managing video and audio files within the admin
https://pypi.org/project/wagtailmedia/
BSD 3-Clause "New" or "Revised" License
224 stars 70 forks source link

Explicitly add in MEDIA_MODEL default to readme config #210

Closed FilipNest closed 12 months ago

FilipNest commented 1 year ago

Very minor documentation bug that threw us for a bit before we worked it out so putting in tiny PR in case helpful:

If you paste in the code for settings.py from the readme I'd expect it to work without any edits:

WAGTAILMEDIA = {
    "MEDIA_MODEL": "",  # string, dotted-notation. Defaults to "wagtailmedia.Media"
    "MEDIA_FORM_BASE": "",  # string, dotted-notation. Defaults to an empty string
    "AUDIO_EXTENSIONS": [],  # list of extensions
    "VIDEO_EXTENSIONS": [],  # list of extensions
}

But the MEDIA_MODEL has to be explicitly set to wagtailmedia.Media rather than the empty string set in the readme. If you leave as is it throws an error.

Alternatively "" could be treated as None and trigger the default if that's a preffered option to this simpler PR.

zerolab commented 12 months ago

Thank you for the nudge @FilipNest. I've made it fully explicit in 087078d