Tijani-Dia / dj-tracker

A Django app that tracks your queries to help optimize them. Demo: https://dj-tracker-bakerydemo.fly.dev/dj-tracker/
https://tijani-dia.github.io/dj-tracker/
BSD 3-Clause "New" or "Revised" License
79 stars 3 forks source link

unsupported operand type(s) for *: 'NoneType' and 'float' #29

Open Natgho opened 11 months ago

Natgho commented 11 months ago

image

Tijani-Dia commented 11 months ago

Hey @Natgho, would you be able to add steps to reproduce the issue please? Never seen this one.

charliemday commented 1 month ago

I'm also experiencing this error, it seems to be here: https://github.com/Tijani-Dia/dj-tracker/blob/b600d7de58931c541ce529d404f107234bef545d/src/dj_tracker/models.py#L142

I'm guessing because average_duration is None (e.g. null=True on its field allowing this). There needs to be some kind of check before passing this into the round function @Tijani-Dia (happy to provide a PR for this)

Tijani-Dia commented 1 month ago

I think you're right @charliemday. A PR would be very welcome.