Welcome @IanVaughanRHD !
First, a Side note: When posting code (or templates, error messages, tracebacks, etc), enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of editing your original post. Please remember to do this in the future.)
Please post the actual error message you are receiving, with the full traceback. (Copy / paste that text into your post as described above.) Also post the complete view that is showing you the error.