Skip to content

Commit

Permalink
Completes previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mauromsl committed Dec 3, 2019
1 parent 974599c commit a58d982
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class JanewayFileSystemStorage(FileSystemStorage):
:param relative_path: relative path on top of settings.MEDIA_ROOT
"""
def __init__(self, location=None, *args, **kwargs):
relative_path = None
if location:
try:
_, relative_path = location.split(settings.MEDIA_ROOT)
except ValueError:
absolute_path = os.path.join(settings.BASE_DIR, location)
relative_path = os.path.relpath(absolute_path, os.getcwd())
else:
relative_path = None
location = os.path.relpath(absolute_path, os.getcwd())

self.relative_path = relative_path
super().__init__(location, *args, **kwargs)

Expand Down

0 comments on commit a58d982

Please sign in to comment.