Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tktaofik committed Jan 4, 2020
1 parent c669345 commit e851ea4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions services/job/service/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydash import pick
from aiohttp import web
from .service import JobService
from .utils import json_serial, get_create_job_properties
from .utils import json_serialize, get_create_job_properties

routes = web.RouteTableDef()

Expand All @@ -16,6 +16,6 @@ async def post_handler(request):
data = pick(data, job_properties)

job = await JobService.create_job(data)
job_json = json.dumps(job, default=json_serial)
job_json = json.dumps(job, default=json_serialize)

return web.json_response(body=job_json, status=200)
2 changes: 1 addition & 1 deletion services/job/service/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .db import job


def json_serial(obj):
def json_serialize(obj):
"""JSON serializer for objects not serializable by default json code"""

if isinstance(obj, (datetime, date)):
Expand Down

0 comments on commit e851ea4

Please sign in to comment.