This isn't solving the issue but I haven't had a chance to fight with the type system long enough to work out what it wants. The perrt_consult_datetime can be null, despite the field being marked as optional it will still try to pass the null/None type into the datetime constructor, which throws an error as it's not a valid number. I tried adding cases to the validator function which is already there, didn't seem to work.
This needs a better solution, but as the dashboard is currently entirely broken with nothing displaying, I'd like to push this to hold us over for now
Note following up on #163