﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30587	Exceptions thrown by  'get_object_or_404()' shortcut  method	Ishwar Bhat	nobody	"When we use get_object_or_404() method to query an object, sometimes due to invalid inputs it will through exceptions. Instead can it raise 404 directly?
Ex:

Models:
>>class Test1(models.Model):
>>    c2 = models.CharField(max_length=10)

>>class Test2(models.Model):
>>    c1 = models.UUIDField(primary_key=True, default=uuid.uuid4)
>>    c2 = models.CharField(max_length=10)

query:
1. Below statement raises valueError:
    >> get_object_or_404(Test1, pk='test') 
    >> - invalid literal for int() with base 10: 'test'

2. Below statement raises ValidationError:
    >> get_object_or_404(Test2, pk=""test"")
    >> - 'test' is not a valid UUID.

So this method will throw diffrent exceptions in diffenrent scenario. So would it be possible to raise 404 exceptions even if it finds invalid values."	New feature	new	Uncategorized	2.2	Normal				Unreviewed	0	0	0	0	0	0
