Skip to content

Commit 9dc1621

Browse files
Rodrigo Dos SantosRodrigo Dos Santos
authored andcommitted
Fixed python api - build python-service
1 parent 6ceaa53 commit 9dc1621

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python-service/app/app/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,11 @@ def get(self):
145145
page = request.args.get("page", 0)
146146
size = request.args.get("size", 10)
147147
log.debug(f'Get all products - page: {page}\t size: {size}')
148-
# products = Product.objects().to_json()
149-
products = Product.objects.paginate(page=page, per_page=size).to_json()
148+
try:
149+
products = Product.objects.paginate(page=page, per_page=size, error_out=False).to_json()
150+
except Exception as e:
151+
log.warn('Did not work pagination', exc_info=e)
152+
products = Product.objects().to_json()
150153
return Response(products, mimetype="application/json", status=200)
151154

152155
"""Create new product"""

0 commit comments

Comments
 (0)