This commit is contained in:
parent
4cde1c14b4
commit
8f6416a73c
|
@ -19,12 +19,10 @@ async def update_follows_for_user(connection, user_id, entity_type, entity, is_i
|
||||||
follows = {
|
follows = {
|
||||||
"topics": [],
|
"topics": [],
|
||||||
"authors": [],
|
"authors": [],
|
||||||
# "shouts": [],
|
|
||||||
"communities": [
|
"communities": [
|
||||||
{"slug": "discours", "name": "Дискурс", "id": 1, "desc": ""}
|
{"slug": "discours", "name": "Дискурс", "id": 1, "desc": ""}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
entity_type = "communitie" if entity_type == "community" else entity_type
|
|
||||||
if is_insert:
|
if is_insert:
|
||||||
follows[f"{entity_type}s"].append(entity)
|
follows[f"{entity_type}s"].append(entity)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -193,7 +193,7 @@ async def get_author(_, _info, slug="", author_id=None):
|
||||||
async def get_author_by_user_id(user_id: str):
|
async def get_author_by_user_id(user_id: str):
|
||||||
redis_key = f"user:{user_id}:author"
|
redis_key = f"user:{user_id}:author"
|
||||||
res = await redis.execute("HGET", redis_key)
|
res = await redis.execute("HGET", redis_key)
|
||||||
if res:
|
if isinstance(res, dict) and res.get("id"):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
logger.info(f"getting author id for {user_id}")
|
logger.info(f"getting author id for {user_id}")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user