fix identity macro

This commit is contained in:
transcental 2025-07-02 10:30:16 +01:00
parent 3a28415bf3
commit 3c851d1cfb

View file

@ -10,7 +10,10 @@ class Identity(Macro):
"""
A simple macro telling people to use the identity help channel
"""
user_info = await env.slack_client.users_info(user=helper.slackId)
sender = await env.db.user.find_first(where={"id": ticket.openedById})
if not sender:
return
user_info = await env.slack_client.users_info(user=sender.slackId)
name = (
user_info["user"]["profile"].get("display_name")
or user_info["user"]["profile"].get("real_name")