Skip to content

Commit

Permalink
Merge pull request #278 from open-contracting/fix/gz-ext
Browse files Browse the repository at this point in the history
fix: improved `.gz` format recognition (library)
  • Loading branch information
mariob0y committed Jun 22, 2021
2 parents 116235d + 3f6a25d commit e0321ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import re
import uuid
from contextlib import contextmanager
from os.path import splitext
from zipfile import ZipFile

import ijson
Expand All @@ -31,8 +30,7 @@

def instance_directory_path(instance, filename):
# file will be uploaded to MEDIA_ROOT/<id>/<filename>
_, extension = splitext(filename)
return "{0}/{1}{2}".format(instance.id, uuid.uuid4().hex, extension)
return "{0}/{1}.json".format(instance.id, uuid.uuid4().hex)


def export_directory_path(instance, filename):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# pip-compile
#
spoonbill==1.0.4b4
spoonbill==1.0.5b4
# via -r requirements.in
aioredis==1.3.1
# via channels-redis
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# pip-compile requirements_dev.in
#
spoonbill==1.0.4b4
spoonbill==1.0.5b4
# via -r requirements.in
aioredis==1.3.1
# via channels-redis
Expand Down

0 comments on commit e0321ab

Please sign in to comment.