Fix installing static media for extensions.
Review Request #13198 — Created Aug. 9, 2023 and submitted — Latest diff uploaded
The recent work to move Djblets over to the modern Python
importlib.resources
andimportlib.metadata
modules regressed the
installation of extension static media. When checking if a resource
exists, we were using.is_file()
, which only returnsTrue
if it's af
file and not a directory. This failed on thestatic
directory.This change switches this to a call to
.exists()
, fixing static media
installation.Unit tests were added to ensure this doesn't break in the future.
Unit test pass.
Deployed this fix to reviews.reviewboard.org and fixed static media
installation for Power Pack.