+12
-12
src/main.py
+12
-12
src/main.py
···
53
53
didkv = KV(db, app.logger, "did_from_handle")
54
54
pdskv = KV(db, app.logger, "pds_from_did")
55
55
56
-
if atid.startswith("@"):
57
-
handle = atid[1:].lower()
58
-
did = await resolve_did_from_handle(handle, kv=didkv, reload=reload)
59
-
if did is None:
60
-
return render_template("error.html", message="did not found"), 404
61
-
elif is_valid_did(atid):
62
-
did = atid
63
-
else:
64
-
return render_template("error.html", message="invalid did or handle"), 400
56
+
async with ClientSession() as client:
57
+
if atid.startswith("@"):
58
+
handle = atid[1:].lower()
59
+
did = await resolve_did_from_handle(client, handle, kv=didkv, reload=reload)
60
+
if did is None:
61
+
return render_template("error.html", message="did not found"), 404
62
+
elif is_valid_did(atid):
63
+
did = atid
64
+
else:
65
+
return render_template("error.html", message="invalid did or handle"), 400
65
66
66
-
if _is_did_blocked(did):
67
-
return render_template("error.html", message="profile not found"), 404
67
+
if _is_did_blocked(did):
68
+
return render_template("error.html", message="profile not found"), 404
68
69
69
-
async with ClientSession() as client:
70
70
pds = await resolve_pds_from_did(client, did=did, kv=pdskv, reload=reload)
71
71
if pds is None:
72
72
return render_template("error.html", message="pds not found"), 404