Skip to content

Commit

Permalink
If only one org in search result, redirects to that org page
Browse files Browse the repository at this point in the history
  • Loading branch information
abkruse committed Dec 26, 2016
1 parent 6280c12 commit c6e1a0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion members/views/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def org_list(request):
if search_form.is_valid():
search_terms = search_form.cleaned_data['terms']
search_results = Organization.objects.search(search_terms)

if len(search_results) == 1:
return HttpResponseRedirect(reverse('member_org_view', kwargs={'org_id': search_results[0].id}))
else:
search_form = OrganizationSearchForm()

Expand Down

0 comments on commit c6e1a0f

Please sign in to comment.