Closed pomegranited closed 4 weeks ago
Thanks for the pull request, @pomegranited!
Please work through the following steps to get your changes ready for engineering review:
If you haven't already, check this list to see if your contribution needs to go through the product review process.
To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
This PR must be merged before / after / at the same time as ...
This PR is waiting for OEP-1234 to be accepted.
This PR must be merged by XX date because ...
This is for a course on edx.org.
If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.
This repository is currently maintained by @axim-engineering
. Tag them in a comment and let them know that your changes are ready for review.
If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
Our goal is to get community contributions seen and reviewed as efficiently as possible.
However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
:bulb: As a result it may take up to several weeks or months to complete a review and merge your PR.
Doesn't block merge, but a couple of questions:
None
?@ormsbee
- Out of curiosity, what storage backend is the sandbox running?
Sandbox uses s3, and it doesn't have a path, just a URL.
From the docs:
The local filesystem path where the file can be opened using Python’s standard open(). For storage systems that aren’t accessible from the local filesystem, this will raise NotImplementedError instead.
- If people are going to be running in this mode commonly, would it make sense to just log a warning and return None?
That's what this change does.. Oh, would you rather a log.warning
instead of log.exception
?
That's what this change does.. Oh, would you rather a
log.warning
instead oflog.exception
?
Yeah, just because log.exception
is really loud/long, and if it's a routine thing, it's not really an error of that sort.
Admin page calls
contents.os_path()
, and if the storage backend doesn't supportpath
, we can't load the admin page for that asset.See e.g https://tagging-preview.staging.do.opencraft.hosting/admin/oel_contents/content/225/change/
Traceback:
``` 2024-10-24 05:36:25,936 ERROR 15 [django.request] [user 20] [ip 180.150.117.27] log.py:241 - Internal Server Error: /admin/oel_contents/content/225/change/ Traceback (most recent call last): File "/openedx/venv/lib/python3.11/site-packages/django/db/models/options.py", line 681, in get_field return self.fields_map[field_name] ~~~~~~~~~~~~~~~^^^^^^^^^^^^ KeyError: 'os_path' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/openedx/venv/lib/python3.11/site-packages/django/contrib/admin/utils.py", line 272, in lookup_field f = _get_non_gfk_field(opts, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/contrib/admin/utils.py", line 303, in _get_non_gfk_field field = opts.get_field(name) ^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/db/models/options.py", line 683, in get_field raise FieldDoesNotExist( django.core.exceptions.FieldDoesNotExist: Content has no field named 'os_path' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/openedx/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 220, in _get_response response = response.render() ^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/template/response.py", line 114, in render self.content = self.rendered_content ^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/template/response.py", line 92, in rendered_content return template.render(context, self._request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/template/base.py", line 175, in render return self._render(context) ^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/template/base.py", line 1005, in render return SafeString("".join([node.render_annotated(context) for node in self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/template/base.py", line 1005, inPrivate-ref: FAL-3908