Skip to content

Commit

Permalink
Update to Django 3.1.12. (#3378)
Browse files Browse the repository at this point in the history
* Update to Django 3.1.12.

* Update changelog and add comment.
  • Loading branch information
msmirn1x authored Jun 30, 2021
1 parent 3e93f95 commit 0c524c6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated manifest format, added meta with related images (<https://github.com/openvinotoolkit/cvat/pull/3122>)
- Update of COCO format documentation (<https://github.com/openvinotoolkit/cvat/pull/3197>)
- Updated Webpack Dev Server config to add proxxy (<https://github.com/openvinotoolkit/cvat/pull/3368>)
- Update to Django 3.1.12 (<https://github.com/openvinotoolkit/cvat/pull/3378>)

### Deprecated

Expand Down
5 changes: 3 additions & 2 deletions cvat/apps/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def get_available_name(self, name, max_length=None):
return name

def upload_path_handler(instance, filename):
return os.path.join(instance.data.get_upload_dirname(), filename)
# relative path is required since Django 3.1.11
return os.path.join(os.path.relpath(instance.data.get_upload_dirname(), settings.BASE_DIR), filename)

# For client files which the user is uploaded
class ClientFile(models.Model):
Expand Down Expand Up @@ -612,4 +613,4 @@ def get_specific_attributes(self):
return {
item.split('=')[0].strip(): item.split('=')[1].strip()
for item in specific_attributes.split('&')
} if specific_attributes else dict()
} if specific_attributes else dict()
2 changes: 1 addition & 1 deletion cvat/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
click==7.1.2
Django==3.1.10
Django==3.1.12
django-appconf==1.0.4
django-auth-ldap==2.2.0
django-cacheops==5.0.1
Expand Down
9 changes: 5 additions & 4 deletions cvat/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
from .development import *
import tempfile

_temp_dir = tempfile.TemporaryDirectory(suffix="cvat")
_temp_dir = tempfile.TemporaryDirectory(dir=BASE_DIR, suffix="cvat")
BASE_DIR = _temp_dir.name

DATA_ROOT = os.path.join(_temp_dir.name, 'data')
DATA_ROOT = os.path.join(BASE_DIR, 'data')
os.makedirs(DATA_ROOT, exist_ok=True)

SHARE_ROOT = os.path.join(_temp_dir.name, 'share')
SHARE_ROOT = os.path.join(BASE_DIR, 'share')
os.makedirs(SHARE_ROOT, exist_ok=True)

MEDIA_DATA_ROOT = os.path.join(DATA_ROOT, 'data')
Expand All @@ -30,7 +31,7 @@

# To avoid ERROR django.security.SuspiciousFileOperation:
# The joined path (...) is located outside of the base path component
MEDIA_ROOT = _temp_dir.name
MEDIA_ROOT = BASE_DIR

# Suppress all logs by default
for logger in LOGGING["loggers"].values():
Expand Down

0 comments on commit 0c524c6

Please sign in to comment.