Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 636e3bba729b4c81ef075013bb35a2cb02286897 1 parent 4a77d56
@guaq authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 membership/views.py
View
6 membership/views.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.