reformat
This commit is contained in:
parent
ec3245dd4f
commit
e96e3a376b
@ -14,7 +14,9 @@ with app.app_context():
|
||||
overlay_config(TestingConfig, "./config-testing.yml")
|
||||
elif app.config["DEBUG"]:
|
||||
overlay_config(DevelopmentConfig)
|
||||
app.logger.warning("Running in DEVELOPMENT MODE; do NOT use this in production!")
|
||||
app.logger.warning(
|
||||
"Running in DEVELOPMENT MODE; do NOT use this in production!"
|
||||
)
|
||||
else:
|
||||
overlay_config(ProductionConfig)
|
||||
|
||||
|
@ -100,7 +100,9 @@ class User(db.Model):
|
||||
"sub": self.username,
|
||||
"jti": jti,
|
||||
}
|
||||
return jwt.encode(payload, current_app.config.get("SECRET_KEY"), algorithm="HS256")
|
||||
return jwt.encode(
|
||||
payload, current_app.config.get("SECRET_KEY"), algorithm="HS256"
|
||||
)
|
||||
|
||||
def read_token(token):
|
||||
"""Read a JWT and validate it.
|
||||
|
@ -270,10 +270,15 @@ class ModelListAPI(MethodView):
|
||||
per_page = int(json_data.get("per_page", 15))
|
||||
page = int(json_data.get("page", 1))
|
||||
except ValueError as e:
|
||||
return jsonify(dict(
|
||||
status="fail",
|
||||
message=str(e),
|
||||
)), 400
|
||||
return (
|
||||
jsonify(
|
||||
dict(
|
||||
status="fail",
|
||||
message=str(e),
|
||||
)
|
||||
),
|
||||
400,
|
||||
)
|
||||
|
||||
page_data = ModelClass.query.paginate(page=page, per_page=per_page)
|
||||
data = [model.get_schema().dump(model) for model in page_data]
|
||||
|
@ -18,7 +18,9 @@ class FileSystem(Storage):
|
||||
self._files_directory.mkdir(mode=0o700, exist_ok=True, parents=True)
|
||||
|
||||
if not self._directory.is_dir():
|
||||
raise OSError(f"'{current_app.config['SACHET_FILE_DIR']}' is not a directory.")
|
||||
raise OSError(
|
||||
f"'{current_app.config['SACHET_FILE_DIR']}' is not a directory."
|
||||
)
|
||||
|
||||
def _get_path(self, name):
|
||||
name = secure_filename(name)
|
||||
|
@ -253,7 +253,6 @@ class TestSuite:
|
||||
)
|
||||
assert resp.status_code == 423
|
||||
|
||||
|
||||
# unlock share
|
||||
resp = client.post(
|
||||
url + "/unlock",
|
||||
|
Loading…
Reference in New Issue
Block a user