Skip to content

Patch #16774 -- Views can raise DoesNotResolve to make the URL resolver continue resolving. #378

Closed
wants to merge 14 commits into from

9 participants

@meric
meric commented Sep 18, 2012

This pull request allows views to raise urlresolvers.DoesNotResolve to make the URL resolver to ignore the view and keep resolving the URL.

https://code.djangoproject.com/ticket/16774
https://groups.google.com/forum/#!topic/django-developers/BAk5pGb7zE8/discussion

alex and others added some commits Sep 10, 2012
@charettes

I don't think this check is required anymore since you're already breaking at line 115.

The break at line 115 was part of a nested loop... I added the check back in the next commit, but now it uses the for-loop else operator.

6ba42de

@charettes

No need to assign the exception to e since it's not used.

@charettes

This should be replaced by an else statement.

@charettes

DoesNotResolve should be imported before get_resolver.

@meric
meric commented on 2ef7d14 Sep 13, 2012

Thanks @charettes!

I've followed your comments and fixed up the code:

a3905d9

https://github.com/meric/django/compare/ticket_16774

@gilsondev

Congratulations!

👍

@timgraham
Django member

It looks like there is a more up-to-date patch on the ticket.

@timgraham timgraham closed this Feb 8, 2014
@alanjds
alanjds commented Sep 25, 2014

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.