Skip to content

Commit

Permalink
don't use deprecated Job.exc_info
Browse files Browse the repository at this point in the history
  • Loading branch information
jvllmr committed Oct 28, 2024
1 parent 780ec24 commit 2b9641a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rq_dashboard/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,13 @@ def serialize_date(dt):
return arrow.get(dt).to("UTC").datetime.isoformat()


def serialize_job(job):
def serialize_job(job: Job):
latest_result = job.latest_result()
return dict(
id=job.id,
created_at=serialize_date(job.created_at),
ended_at=serialize_date(job.ended_at),
exc_info=str(job.exc_info) if job.exc_info else None,
exc_info=str(latest_result.exc_string) if latest_result else None,
description=job.description,
)

Expand Down

0 comments on commit 2b9641a

Please sign in to comment.