mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-21 23:01:00 +00:00
Misc lemmy compat (#635)
This commit is contained in:
parent
2a50928f27
commit
671807beb8
2 changed files with 4 additions and 2 deletions
|
@ -281,7 +281,7 @@ class Emoji(StatorModel):
|
|||
# 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")
|
||||
|
|
|
@ -13,7 +13,7 @@ from api.decorators import scope_required
|
|||
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,
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue