Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc lemmy compat #635

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion activities/models/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def by_ap_tag(cls, domain: Domain, data: dict, create: bool = False):
# Name could be a direct property, or in a language'd value
if "name" in data:
name = data["name"]
elif "nameMap" in data:
elif "nameMap" in data and "und" in data["nameMap"]:
name = data["nameMap"]["und"]
else:
raise ValueError("No name on emoji JSON")
Expand Down
4 changes: 3 additions & 1 deletion api/views/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def search(
request,
q: str,
type: Literal["accounts", "hashtags", "statuses"] | None = None,
type: Literal["accounts", "hashtags", "statuses", ""] | None = None,
fetch_identities: bool = Field(False, alias="resolve"),
following: bool = False,
exclude_unreviewed: bool = False,
Expand All @@ -33,6 +33,8 @@ def search(
# Run search
searcher = SearchService(q, request.identity)
search_result = searcher.search_all()
if type == "":
type = None
if type is None or type == "accounts":
result["accounts"] = [
schemas.Account.from_identity(i, include_counts=False)
Expand Down
Loading