umutbozkurt/django-rest-framework-mongoengine

Return 404 for invalid lookup value

Vayel opened this issue · 2 comments

Vayel commented

For a model viewset with a lookup field being an ObjectId, such a request raises an exception:

/model/invalid_object_id/
'invalid_object_id' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string

Instead, we should return a 404 error.

Vayel commented

Maybe should return a 400 instead. Check how DRF behaves.

Vayel commented

Already fixed by 6d5d164