Commit bdba920e21ee60ae93d0d4817e13a8c72fe76743
1 parent
3b7c35da
Exists in
master
add default limit = 10
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
wscserver/view/restfulview.py
| ... | ... | @@ -34,7 +34,7 @@ def viewcoleta(request): |
| 34 | 34 | # Please ensure this index exists on database |
| 35 | 35 | # CREATE INDEX idx_id_computador ON computador_coleta(id_computador); |
| 36 | 36 | |
| 37 | - limit = request.params.get('limit', 'NULL') | |
| 37 | + limit = request.params.get('limit', '10').upper() | |
| 38 | 38 | |
| 39 | 39 | stmt1 = """ |
| 40 | 40 | SELECT id_computador |
| ... | ... | @@ -77,7 +77,7 @@ def viewcoleta(request): |
| 77 | 77 | |
| 78 | 78 | f.write(FILE_END % computer_ids.rowcount) |
| 79 | 79 | |
| 80 | - if '1' in tuple(request.params.get('zip')): | |
| 80 | + if '1' in tuple(request.params.get('zip', '0')): | |
| 81 | 81 | |
| 82 | 82 | with zipfile.ZipFile('/tmp/coleta.zip', 'w') as myzip: |
| 83 | 83 | myzip.write('/tmp/coleta.json') | ... | ... |