Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor asset storage admin issue [FC-0062] #247

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions openedx_learning/apps/authoring/contents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from __future__ import annotations

from functools import cache, cached_property
from logging import getLogger

from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ValidationError
Expand All @@ -19,6 +20,8 @@
from ....lib.managers import WithRelationsManager
from ..publishing.models import LearningPackage

logger = getLogger()

__all__ = [
"MediaType",
"Content",
Expand Down Expand Up @@ -316,8 +319,11 @@ def os_path(self):

This will return ``None`` if there is no backing file (has_file=False).
"""
if self.has_file:
return get_storage().path(self.path)
try:
if self.has_file:
return get_storage().path(self.path)
except NotImplementedError as err:
logger.exception(err)
return None

def read_file(self) -> File:
Expand Down