rcpch / national-paediatric-diabetes-audit

A django application to audit the care of children and young people with diabetes in England and Wales.
0 stars 1 forks source link

Adds a check to template tag to prevent NoneType error being thrown #52

Closed dc2007git closed 1 month ago

dc2007git commented 1 month ago

This PR resolves a small bug found in a template tag. A parameter called 'messages' is set in the tag error_for_field, but if messages is a NoneType (ie there are no messages to pass in, then we can't perform the later len(messages) operation.

This sets messages equal to an empty list (if it is equal to None) so that the len(messages) operation can be performed