Permalink
Browse files

Fix bug with search term "#"

It used to just plain break because it couldn't
find reverse url for the membership edit.
  • Loading branch information...
1 parent 4a77d56 commit 636e3bba729b4c81ef075013bb35a2cb02286897 @guaq committed May 12, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 membership/views.py
View
@@ -897,8 +897,12 @@ def search(request, **kwargs):
extra['search_query'] = query
kwargs['extra_context'] = extra
+ # Shorthand for viewing a membership by giving # and the id
if query.startswith("#"):
- return redirect('membership_edit', query.lstrip("#"))
+ try:
+ return redirect('membership_edit', int(query.lstrip("#")))
+ except ValueError, ve:
+ pass
qs = Membership.search(query)

0 comments on commit 636e3bb

Please sign in to comment.