reformatted code again
i should probably put Black in a commit hook or something but nahhhh can't be that bad
This commit is contained in:
parent
bb3731cc6d
commit
2388bac57f
@ -30,10 +30,7 @@ class FilesMetadataAPI(ModelAPI):
|
||||
try:
|
||||
uuid.UUID(share_id)
|
||||
except ValueError:
|
||||
return jsonify(dict(
|
||||
status="fail",
|
||||
message=f"Invalid ID: '{share_id}'."
|
||||
))
|
||||
return jsonify(dict(status="fail", message=f"Invalid ID: '{share_id}'."))
|
||||
share = Share.query.filter_by(share_id=share_id).first()
|
||||
return super().delete(share)
|
||||
|
||||
|
@ -251,8 +251,10 @@ class ModelListAPI(MethodView):
|
||||
page_data = ModelClass.query.paginate(page=page, per_page=per_page)
|
||||
data = [model.get_schema().dump(model) for model in page_data]
|
||||
|
||||
return jsonify(dict(
|
||||
data=data,
|
||||
prev=page_data.prev_num,
|
||||
next=page_data.next_num,
|
||||
))
|
||||
return jsonify(
|
||||
dict(
|
||||
data=data,
|
||||
prev=page_data.prev_num,
|
||||
next=page_data.next_num,
|
||||
)
|
||||
)
|
||||
|
@ -91,9 +91,7 @@ class TestSuite:
|
||||
resp = client.put(
|
||||
url + "/content",
|
||||
headers=auth("jeff"),
|
||||
data={
|
||||
"upload": FileStorage(stream=BytesIO(new_data), filename="upload")
|
||||
},
|
||||
data={"upload": FileStorage(stream=BytesIO(new_data), filename="upload")},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
|
||||
@ -105,7 +103,6 @@ class TestSuite:
|
||||
assert resp.data == new_data
|
||||
assert "filename=new_bin.bin" in resp.headers["Content-Disposition"].split("; ")
|
||||
|
||||
|
||||
def test_invalid(self, client, users, auth, rand):
|
||||
"""Test invalid requests."""
|
||||
|
||||
|
@ -45,10 +45,7 @@ def test_files(client, users, auth):
|
||||
per_page = 9
|
||||
while page is not None:
|
||||
resp = client.get(
|
||||
"/files", headers=auth("jeff"), json=dict(
|
||||
page=page,
|
||||
per_page=per_page
|
||||
)
|
||||
"/files", headers=auth("jeff"), json=dict(page=page, per_page=per_page)
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user