Skip to content

Commit f1fee97

Browse files
committed
Fix for quote_from_bytes() error, closes #2
1 parent f14c8a1 commit f1fee97

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

datasette_profiles/__init__.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ async def edit_profile(request: Request, datasette):
159159
# Get avatar URL if it exists
160160
avatar_url = None
161161
if profile_data.get("has_avatar"):
162-
avatar_url = _get_avatar_url(datasette, actor_id)
162+
avatar_url = _get_avatar_url(datasette, str(actor_id))
163163

164164
return Response.html(
165165
await datasette.render_template(
166166
"edit_profile.html",
167167
{
168168
"profile": profile_data,
169-
"profile_url": datasette.urls.path(f"/~{quote(actor_id)}"),
169+
"profile_url": datasette.urls.path(f"/~{quote(str(actor_id))}"),
170170
"avatar_url": avatar_url,
171171
"message": message,
172172
},
@@ -217,7 +217,7 @@ async def view_profile(request: Request, datasette):
217217
profile_data = dict(profile_row)
218218
avatar_url = None
219219
if profile_data.get("has_avatar"):
220-
avatar_url = _get_avatar_url(datasette, profile_data["id"])
220+
avatar_url = _get_avatar_url(datasette, str(profile_data["id"]))
221221

222222
return Response.html(
223223
await datasette.render_template(
@@ -257,7 +257,9 @@ async def list_profiles(request: Request, datasette):
257257
# Determine the correct URL for the profile view
258258
profile_dict["view_url"] = datasette.urls.path(f"/~{quote(profile_dict['id'])}")
259259
if profile_dict["has_avatar"]:
260-
profile_dict["avatar_url"] = _get_avatar_url(datasette, profile_dict["id"])
260+
profile_dict["avatar_url"] = _get_avatar_url(
261+
datasette, str(profile_dict["id"])
262+
)
261263
else:
262264
profile_dict["avatar_url"] = None
263265
profiles_list.append(profile_dict)

0 commit comments

Comments
 (0)