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

IntegrityError - trying to set a field to Null but Django not allowing it #115

Closed dc2007git closed 2 weeks ago

dc2007git commented 3 weeks ago

In the New Patient form, upon submission, an IntegrityError gets raised as below:

image

This is because in the model, we have not set null=True, because we want every patient to have a site attached. However it seems like this functionality is not working.

I do seem to recall however being able to manually add patients to the platform. @eatyourpeas , could this be due to the Migration changes we made a while back, in PR #87 ? To the best of my knowledge, the last time we made changes to the models/migrations was here.

eatyourpeas commented 2 weeks ago

i would start by creating a fresh instance of the database etc - it may just be that.

dc2007git commented 2 weeks ago

Thanks for fixing this @eatyourpeas ! You'll have to walk me through how in the sprint ;)