culturesofknowledge / emlo-project

Repository to manage the upgrade, development and maintenance of EMLO
0 stars 0 forks source link

Is_blank for integer field throws SQL type error #283

Closed J4bbi closed 1 year ago

J4bbi commented 1 year ago

If you search by is blank for any of the integer fields, CofkUnionWork.date_of_work_std_year, CofkUnionWork.date_of_work_std_month or CofkUnionWork.date_of_work_std_day,

you get a SQL Type error:

DataError at /work/search
invalid input syntax for type integer: ""
LINE 1: ...td_year" IS NULL OR W0."date_of_work_std_year" = ('')) AND W...

https://github.com/culturesofknowledge/site-edit-2/blob/6838d39c5e71c04189955282e25be344aa57a343/sharedlib/djangolib/query_utils.py#L78

I'm not sure how best to resolve this as there is no information on the model field types at this stage.