mirror of
https://github.com/System-End/nephthys.git
synced 2026-04-19 16:28:16 +00:00
Fix the alaninnovates bug (#134)
* Add a little log * Ensure closed tickets are attributed to helpers correctly * Add a success log when a ticket is resolved
This commit is contained in:
parent
43967cf289
commit
e9455e0d1c
1 changed files with 7 additions and 1 deletions
|
|
@ -37,9 +37,13 @@ async def resolve(
|
|||
)
|
||||
return
|
||||
ticket = await env.db.ticket.find_first(
|
||||
where={"msgTs": ts, "NOT": [{"status": TicketStatus.CLOSED}]}
|
||||
where={"msgTs": ts, "NOT": [{"status": TicketStatus.CLOSED}]},
|
||||
include={"assignedTo": True},
|
||||
)
|
||||
if not ticket:
|
||||
logging.warning(
|
||||
f"Failed to resolve ticket ts={ts} because it's already closed or doesn't exist."
|
||||
)
|
||||
return
|
||||
|
||||
if not resolving_user.helper and ticket.assignedTo:
|
||||
|
|
@ -100,3 +104,5 @@ async def resolve(
|
|||
await delete_message(
|
||||
channel_id=env.slack_ticket_channel, message_ts=tkt.ticketTs
|
||||
)
|
||||
|
||||
logging.info(f"Resolved ticket ts={ts} resolving_user={resolving_user.slackId}")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue