edoburu / django-private-storage

@@ -1,7 +1,7 @@
Loading
1 -
from django.conf.urls import url
1 +
from django.urls import re_path
2 2
3 3
from .views import PrivateStorageView
4 4
5 5
urlpatterns = [
6 -
    url(r'^(?P<path>.*)$', PrivateStorageView.as_view(), name='serve_private_file'),
6 +
    re_path(r'^(?P<path>.*)$', PrivateStorageView.as_view(), name='serve_private_file'),
7 7
]

@@ -4,7 +4,7 @@
Loading
4 4
from django.core.files.storage import FileSystemStorage
5 5
from django.urls import reverse_lazy
6 6
from django.utils.deconstruct import deconstructible
7 -
from django.utils.encoding import force_text
7 +
from django.utils.encoding import force_str
8 8
9 9
from private_storage import appconfig
10 10
@@ -32,6 +32,6 @@
Loading
32 32
            self.base_url = reverse_lazy('serve_private_file', kwargs={'path': ''})
33 33
34 34
    def url(self, name):
35 -
        # Make sure reverse_lazy() is evaluated, as Python 3 won't do this here.
36 -
        self.base_url = force_text(self.base_url)
35 +
        # Make sure reverse_lazy() is evaluated
36 +
        self.base_url = force_str(self.base_url)
37 37
        return super(PrivateFileSystemStorage, self).url(name)

@@ -13,7 +13,7 @@
Loading
13 13
from django.db.models.fields.files import ImageFieldFile, ImageFileDescriptor
14 14
from django.forms import ImageField
15 15
from django.template.defaultfilters import filesizeformat
16 -
from django.utils.encoding import force_str, force_text
16 +
from django.utils.encoding import force_str
17 17
from django.utils.translation import gettext_lazy as _
18 18
19 19
from .storage import private_storage
@@ -72,7 +72,7 @@
Loading
72 72
                dirname, filename = os.path.split(self.upload_to(instance, filename))
73 73
                path_parts.append(dirname)
74 74
            else:
75 -
                dirname = force_text(datetime.datetime.now().strftime(force_str(self.upload_to)))
75 +
                dirname = force_str(datetime.datetime.now().strftime(force_str(self.upload_to)))
76 76
                path_parts.append(dirname)
77 77
78 78
        # Add our custom subdir function.
Files Coverage
private_storage 71.64%
Project Totals (16 files) 71.64%
97.2
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
97.3
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
97.1
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
97.4
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
97.5
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading