summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-02-03 16:11:38 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-02-03 16:11:38 +0800
commitabff246c6af8bf64fce12e5f95fd54e3787d470b (patch)
tree7b0cdfad270eaa603e60b58932a9271a3b747619
parent616116a84120220adb8e36cb364f08b0a638807e (diff)
Reformat w/ black
-rw-r--r--jimbrella/admin.py6
-rw-r--r--jimbrella/admin_log.py4
-rw-r--r--jimbrella/jform.py4
-rw-r--r--jimbrella/web.py2
4 files changed, 11 insertions, 5 deletions
diff --git a/jimbrella/admin.py b/jimbrella/admin.py
index 799ff66..60f7596 100644
--- a/jimbrella/admin.py
+++ b/jimbrella/admin.py
@@ -65,9 +65,9 @@ def umbrellas():
# web interface provides no timezone so UTC+8 is assumed
lent_at = isoparse(umb["lent_at"]).replace(tzinfo=CST)
umb["lent_at"] = lent_at.isoformat(timespec="seconds")
- umb["lent_time_ago"] = human_timedelta(
- datetime.now().astimezone(CST) - lent_at
- ) + " ago"
+ umb["lent_time_ago"] = (
+ human_timedelta(datetime.now().astimezone(CST) - lent_at) + " ago"
+ )
except ValueError:
umb["lent_at"] = "Invalid date"
umb["lent_time_ago"] = ""
diff --git a/jimbrella/admin_log.py b/jimbrella/admin_log.py
index bb57787..3a390a1 100644
--- a/jimbrella/admin_log.py
+++ b/jimbrella/admin_log.py
@@ -108,7 +108,9 @@ class AdminLog:
)
elif event == "ADMIN_MODIFY_DB":
if not entry["past_value"]:
- description = "{admin_name} set {column} of umbrella #{id} to {new_value}."
+ description = (
+ "{admin_name} set {column} of umbrella #{id} to {new_value}."
+ )
elif not entry["new_value"]:
description = "{admin_name} cleared {column} of umbrella #{id} (was {past_value})."
else:
diff --git a/jimbrella/jform.py b/jimbrella/jform.py
index c6503c1..df1837e 100644
--- a/jimbrella/jform.py
+++ b/jimbrella/jform.py
@@ -122,7 +122,9 @@ class JForm:
"name": ans[0]["answer"],
"id": ans[1]["answer"],
"phone": ans[2]["answer"],
- "key": int(ans[3]["answer"]) if ans[3]["answer"].isdecimal() else None,
+ "key": int(ans[3]["answer"])
+ if ans[3]["answer"].isdecimal()
+ else None,
"date": isoparse(sheet["submitted_at"]),
}
)
diff --git a/jimbrella/web.py b/jimbrella/web.py
index a2b66b8..479c22a 100644
--- a/jimbrella/web.py
+++ b/jimbrella/web.py
@@ -10,10 +10,12 @@ from .config import *
app = Flask("jimbrella")
app.secret_key = FLASK_SECRET_KEY
+
@app.route("/")
def index():
return render_template("index.html")
+
app.register_blueprint(admin_bp)
app.register_blueprint(auth_bp)