Skip to content

Commit 4fbc686

Browse files
committed
PR 4: Samples Endpoints
1 parent fff7f45 commit 4fbc686

11 files changed

Lines changed: 945 additions & 58 deletions

File tree

.pycodestylerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
count = True
33
max-line-length = 120
44
exclude=test_diff.py,migrations,venv*,.venv*,parse.py,config.py
5-
ignore = E701
5+
ignore = E701,W503

mod_api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@
3636
# Route modules
3737
from mod_api.routes import auth as auth_routes # noqa: E402, F401
3838
from mod_api.routes import runs as runs_routes # noqa: E402, F401
39+
from mod_api.routes import samples as samples_routes # noqa: E402, F401
3940
from mod_api.routes import system as system_routes # noqa: E402, F401

mod_api/middleware/error_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ def convert_api_errors_to_json(response):
151151
response.data = new_resp.data
152152
response.mimetype = new_resp.mimetype
153153
return response
154-
if response.status_code == 404:
154+
if response.status_code == 404 and not response.is_json:
155155
new_resp = make_error_response('not_found', 'Resource not found.', http_status=404)
156156
response.data = new_resp.data
157157
response.mimetype = new_resp.mimetype
158158
return response
159-
if response.status_code == 405:
159+
if response.status_code == 405 and not response.is_json:
160160
new_resp = make_error_response('method_not_allowed', 'Method not allowed.', http_status=405)
161161
response.data = new_resp.data
162162
response.mimetype = new_resp.mimetype

mod_api/routes/runs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def list_runs(
235235

236236
if status_filter == 'queued':
237237
query = query.outerjoin(TestProgress).filter(
238-
TestProgress.id is None)
238+
TestProgress.id.is_(None))
239239
elif status_filter == 'running':
240240
query = query.join(
241241
TestProgress,

0 commit comments

Comments
 (0)