Closed Bug 565502 Opened 15 years ago Closed 15 years ago

[k] Replace excess try blocks with get_object_or_404

Categories

(support.mozilla.org :: Knowledge Base Software, task, P3)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jsocol, Assigned: jgross)

Details

(Whiteboard: [qa-][code quality][good first bug])

In forums.views there are a number of place we do basically this: try: obj = Cls.objects.get(x=y) except Cls.DoesNotExist: return Http404 That is just the long hand form of: from django.shortcuts import get_object_or_404 obj = get_object_or_404(Cls, x=y) For clarity and suscin...su....being concise, we should use the shortcut.
Assignee: nobody → jgross
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.