This commit is contained in:
Sebastien Corbin
2022-01-17 13:44:27 +01:00
committed by Sébastien Corbin
parent 63c3d7d2dc
commit 382c824cca
3 changed files with 27 additions and 23 deletions

View File

@@ -11,7 +11,7 @@ jobs:
- '2.2'
- '3.2'
- '4.0'
python_version:
python-version:
- 3.6
- 3.7
- 3.8
@@ -19,13 +19,13 @@ jobs:
- "3.10"
exclude:
- django_version: '2.2'
python_version: '3.10'
python-version: '3.10'
- django_version: '4.0'
python_version: '3.6'
python-version: '3.6'
- django_version: '4.0'
python_version: '3.7'
python-version: '3.7'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -33,17 +33,17 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python_version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python_version: ${{ matrix.python_version }}
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python_version }}-${{ matrix.django_version }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.django_version }}
- name: Install dependencies
run: |
@@ -58,7 +58,7 @@ jobs:
- name: Test Django
run: |
python -W error::DeprecationWarning -W error::PendingDeprecationWarning \
-m coverage run runtests.py
-m coverage run ./runtests.py
- name: Coverage
if: ${{ success() }}

View File

@@ -14,8 +14,12 @@ def draw_signature(data, as_file=False):
`data` can be a json object (list in fact) or a json string
if `as_file` is True, a temp file is returned instead of Image instance
"""
def _remove_empty_pts(pt):
return {'x': list(filter(lambda n: n is not None, pt['x'])), 'y': list(filter(lambda n: n is not None, pt['y']))}
return {
'x': list(filter(lambda n: n is not None, pt['x'])),
'y': list(filter(lambda n: n is not None, pt['y']))
}
if type(data) is str:
drawing = json.loads(data, object_hook=_remove_empty_pts)